|
|
1.1 root 1: (* Copyright 1989 by AT&T Bell Laboratories *)
2: (* importer.sig: this is all the Interact functor needs from the import
3: mechanism. *)
4:
5: signature IMPORTER =
6: sig
7: exception Import of string
8: (* Raised for any sensible failure to import. *)
9:
10: type lvar sharing type lvar = Access.lvar
11:
12: (* We essentially have mutual recursion between Interact and Importer -
13: Interact needs to be able to import things, and Importer needs to
14: be able to implement a top-level loop. The ideal solution is to put
15: the functions bind, lookup, etc. into a common sub-module. The slightly
16: hacked solution, here, is to model the recursion by passing part of
17: Interact's environment (the functions) in a record to Importer. *)
18:
19: datatype ToplevelFns =
20: TOPLEVEL_FNS of {bind: lvar * System.Unsafe.object -> unit,
21: lookup: lvar -> System.Unsafe.object,
22: parse: Lex.lexer -> BareAbsyn.dec,
23: getvars: BareAbsyn.dec -> lvar list,
24: opt: Lambda.lexp -> Lambda.lexp
25: }
26:
27: val getAndExecModule: string * Env.env * ToplevelFns -> unit
28: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.