SketchyLISP Reference Manual - Copyright (C) 2005 Nils M Holm
Previous: Differences to Scheme | - Index - | Next: References |
:C | :D | :F | :G | :I | :K | :L | :Q | :S | :T | :V | :W
A meta command is entered by typing a colon (:) followed by the command itself on an empty line and without any parentheses left open. Meta commands affect the interpreter itself rather than expressions reduced by the interpreter.
:c file
Load the content of the given file in the same way as :l, but only if the Symbol file is undefined or bound to (). If a path name is specified in file, only the base name will be used to look up the associated Symbol, so both of the following examples will work:
:c x.l :c path/x.l
This command is intended for loading mutally recursive definitions.
:d file
Dump the complete workspace of the interpreter to the given file. The image can be re-loaded by passing the name of the image file to the interpreter at startup time:
sketchy image-file-name
:f on|off (default: ON)
Turn function tracking on or off. When function tracking is on, the names of offending functions will be included in error messages. Function tracking costs the allocation of one additional Atom per function application.
:g
Run garbage collection and print some statistics.
:i on|off (default: ON)
When the imploded numbers option is enabled, numeric literals will be automatically converted to Lists of digits on input and Lists of digits will be automatically imploded on output. For instance,
12345
will be internally stored as
'(#<number> 1 2 3 4 5)
Because conversion takes place on input and output, though, this internal form is invisible to the user:
(+ 123 456) => 579
With imploded numbers disabled, sequences of digits are treated as ordinary symbols, so numbers will not work.
This option is a compatibility option that allows purely symbolic programs using numbers as symbols to be interpreted by SketchyLISP.
:k 0|1|2 (default: 0)
The closure print level determines how much of a closure will print when the normal form of a reduction is a closure. By default, only the argument list of a closure will print:
(letrec* ((x 'foo)) (lambda (y) (cons y x))) => #<closure (y)>
With the :k 1 set, the body of the closure will be included, so the normal form of above expression would print as:
#<closure (y) (cons x y)>
Using the :k 2, the lexical context of the closure is included as well:
#<closure (y) (cons x y) ((x.foo))>
Setting :k 1 is normally a good idea, because closures may contain self-referential structures that take infinite time to print.
:l file
Load the content of file as if typed in at the command line. Reduced expressions will not be echoed. The file name will be converted to all lower case.
:q
Quit.
:s on|off (default: OFF)
Switch statistics mode on or off. In statistics mode, the total number of calls to eval and the number of nodes allocated during the reduction will print after each evaluation.
Here is an example:
(cons 'a 'b) => '(a.b) 6 calls to eval 25 nodes allocated
These statistics are not easy to interpret and do not provide much more than a rough basis for comapring algorithms. In the above example the six calls to eval are the following:
(cons (quote a) (quote b)) cons (quote a) quote (quote b) quote
The process allocates 25 nodes (which are roughly equivalent to Atoms), because the interpreter itself allocates temporary storage during reduction.
:t [name]
Turn trace mode on/off. In trace mode, the interpreter will print each application of the specified function after reducing the arguments but before reducing the function Symbol. Each trace line will be prefixed with an asterisk (*). To turn off tracing, use :t without any argument.
:v[l]
Print version info. :vl prints the conditions of use (license).
:w col (default: 0)
Set the wrap column for output lines to col (1...255). The special col value 0 disables wrap-around.
Previous: Differences to Scheme | - Index - | Next: References |