© Jørgen Steensgaard-Madsen, Copenhagen, 2006
Some operations depend on semantics defined in the common
interpretation engine, without being required for basic processing. A
typical example is means to obtain command line options.
The following type operators are defined internally
void int real string Text Output
The following types are globally bound, i.e. should be predefined
in some contribution. A number before a type operator name tells
how many types are needed to form a type of the named kind - e.g.
one type (the element type) is required to determine a list type.
NONE complex Input 1 Array 1 List
2 Tuple 1 Option 1 Tree
[ stdout: Output ]
[ stderr: Output ]
[ stdin: Input ]
Names used conventionally for the standard ports of a POSIX process.
( argv : string Array )
Command line arguments, which follow a "-" argument, and are
numbered 0, 1, 2, ... Arguments that precede "-" vary the
behaviour of the interpreter.
[ INTERPRET OF T : T ]
[ _ OF T : T ]
Both call for embedded interpretation: read an expression
through the interpreter's scanner/parser and interpret it in the
context where the operation is applied.
[ include OF W (file:string)[Body:W] : W ]
The file clause must compute the
path of a file. The contents of the file is dynamically inserted into
the interpreter's input data stream, the Body clause is
evaluated and its result is returned as the result of the application.
Combined with the INTERPRET expression this allows, for
instance, the file to be read and interpreted as a list of expressions.
[ source OF W (file:Input) [Body:W] ]
Similar in nature to include, but depends on an open file
instead of a path name. After evaluation of the Body
clause, the interpreter will not read further from file.
[ signature(Name:string) ]
Writes the signature of operation Name on standard output.
|File translated from
|On 18 Oct 2006, 16:47.