[previous] [up] [next]     [index]
Next: Pattern Matching Up: Vocabulary Previous: zodiac:merge-vocabulary

Linking

Zodiac has been written so that it can be used independently of the graphical components of DrScheme. Its only requirement is that it be run under MzScheme (or any other ``sufficiently compatible'' system). Thus, Zodiac can be used with tools both within and without DrScheme. Linking to Zodiac inside DrScheme is done as part of the standard interface for DrScheme tools. This section describes how a tool linking directly to Zodiac should do so.

The code for Zodiac is found in the zodiac directory of the Rice PLT distribution (say this path is bound to plt-home). To load Zodiac into the system, use

  (require-library "fileu.ss") ; to load load-recent 
  (load-recent (build-path plt-home "zodiac" "load")) 

This will ensure all the files are loaded, and that the compiled versions are loaded where available and newer than their source. All the Zodiac signatures mentioned below are in the file sigs.ss.

Any unit wanting to use the Zodiac procedures must include the signature zodiac:system&#;"5E among its imports. The unit zodiac:system@, which satisfies this signature, contains all the requisite code. Linking to zodiac:system@ requires it be passed two parameters, in this order:

Error Interface
Zodiac requires an implementation of the error handlers (Section [cross-reference]). Thus, a unit satisfying the signature zodiac:interface&#;"5E, containing the error handlers that have the described types, must be provided. Zodiac provides a default unit with no imports, zodiac:default-interface@, that meets this signature, but those procedures will likely be unsatisfactory for most presentation needs. They are provided only to provide a template and to reduce the effort needed to start using Zodiac; users are strongly encouraged to replace them.

Language Parameters
Zodiac takes several parameters that customize its language. These are listed in the signature plt:parameters&#;"5E (from the file sparams.ss in the directory lib of the PLT distribution), and the settings for MzScheme are in the unit plt:mzscheme-parameters@. Invoking this latter unit with no arguments will yield the appropriate values, which can then be passed to Zodiac.

The implementation of zodiac:default-interface@, and a sample linkage, can be found in the file invoke.ss.

NOTE: It is suggested that users of Zodiac use the prefix mechanism while importing into a unit to prefix all Zodiac names. Since the system is not entirely documented, this will prevent unexpected name clashes (though if they should arise, the file sigs.ss should be consulted to see what names are exported). In addition, Zodiac provides different definitions for standard Scheme primitives such as read and make-vector. Mixing these values with traditional Scheme primitives will lead to confusion and, sometimes, insidious errors. Using a prefix helps the user clarify when a Zodiac primitive is desired and when the Scheme primitive should be used instead.



[previous] [up] [next]     [index]
Next: Pattern Matching Up: Vocabulary Previous: zodiac:merge-vocabulary

PLT