[previous] [up] [next]     [contents] [index]
Next: Pattern Matching Up: PLT McMicMac: Parser Manual Previous: Reporting Errors

Linking

McMicMac 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, McMicMac can be used with tools both within and without DrScheme. Linking to McMicMac inside DrScheme is done as part of the standard interface for DrScheme tools. This section describes how a tool linking directly to McMicMac should do so.

The code for McMicMac is found in the zodiac directory of the Rice PLT distribution (say this path is bound to plt-home). To load McMicMac 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 McMicMac signatures mentioned below are in the file sigs.ss.

Any unit wanting to use the McMicMac 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
McMicMac requires an implementation of the error handlers (Section 4.5). Thus, a unit satisfying the signature zodiac:interface&#;"5E, containing the error handlers that have the described types, must be provided. McMicMac\ 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 McMicMac; users are strongly encouraged to replace them.

Language Parameters
McMicMac 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 McMicMac.

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 McMicMac use the prefix mechanism while importing into a unit to prefix all McMicMac 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, McMicMac\ 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 McMicMac\ primitive is desired and when the Scheme primitive should be used instead.


[previous] [up] [next]     [contents] [index]
Next: Pattern Matching Up: PLT McMicMac: Parser Manual Previous: Reporting Errors

PLT