2.1 Mathematical characters2.1 Mathematical characters
2 Putting RSL into files 2 Putting RSL into files
2.2 Contexts

2.2 Contexts

A module (scheme or object) S that uses other modules A and B needs to tell the type checker that A and B are its context. The file S.rsl for S will start

A, B

scheme S = ...

The type checker will check A and B (recursively including any modules in their contexts) and then S. The order of A and B does not matter. If B is also in the context of A then it does not matter if B is included in the context of S or not.

The context illustrated above means that the type checker will look for A.rsl and B.rsl in the same directory as S.rsl. Context files may also be in other directories (on the same drive in Windows). References to them may use absolute or relative paths, and Unix-style paths are used (so that RSL files may be passed between Windows and Unix systems).

For example, suppose S.rsl is in /home/user/raise/rsl, and A.rsl is in
/home/user/raise/rsl/lower. Then the context reference to A in S.rsl may be

 
lower/A  or
/home/user/raise/rsl/lower/A  or even
 ../rsl/lower/A

When a module is checked, the context modules are checked first, so you only need run the tool on top level modules.


Chris George, April 17, 2008

2.2 Contexts
2.1 Mathematical characters2.1 Mathematical characters
2 Putting RSL into files 2 Putting RSL into files