XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

31  System Functions


  1. load - load a source file
  2. save - save workspace to a file
  3. restore - restore workspace from a file
  4. dribble - create a file with a transcript of a session
  5. gc - force garbage collection
  6. expand - expand memory by adding segments
  7. alloc - change number of nodes to allocate in each segment
  8. room - show memory allocation statistics
  9. type-of - returns the type of the expression
  10. peek - peek at a location in memory
  11. poke - poke a value into memory
  12. address-of - get the address of an xlisp node
  13. system - execute a command of the operating system
  14. exit - exit xlisp

Nyquist: in Nyquist, the XLISP 'load' function first tries to load a file from the current directory. A '.lsp' extension is added if there is not already an alphanumeric extension following a period. If that fails, XLISP searches the path, which is obtained from the XLISPPATH environment variable in Unix and HKEY_LOCAL_MACHINE\SOFTWARE\CMU\Nyquist\XLISPPATH under Win32. [The Macintosh version has no search path.]

Note: All XLISP system functions added by Nyquist can be found in Chapter 34.


(load fname &key :verbose :print) - load a source file
fname - the filename string or symbol
:verbose - the verbose flag, default is T
:print - the print flag, default is NIL
returns - the filename

(save fname) - save workspace to a file
fname - the filename string or symbol
returns - T if workspace was written, NIL otherwise

(restore fname) - restore workspace from a file
fname - the filename string or symbol
returns - NIL on failure, otherwise never returns

(dribble [fname]) - create a file with a transcript of a session
fname - file name string or symbol [if missing, close current transcript]
returns - T if the transcript is opened, NIL if it is closed

(gc) - force garbage collection
returns - NIL

(expand num) - expand memory by adding segments
num - the number of segments to add
returns - the number of segments added

(alloc num) - change number of nodes to allocate in each segment
num - the number of nodes to allocate
returns - the old number of nodes to allocate

(room) - show memory allocation statistics
returns - NIL

(type-of expr) - returns the type of the expression
expr - the expression to return the type of
returns - NIL if the value is NIL otherwise one of the symbols:
SYMBOL - for symbols
OBJECT - for objects
CONS - for conses
SUBR - for built-in functions
FSUBR - for special forms
CLOSURE - for defined functions
STRING - for strings
FIXNUM - for integers
FLONUM - for floating point numbers
CHARACTER - for characters
FILE-STREAM - for file pointers
UNNAMED-STREAM - for unnamed streams
ARRAY - for arrays

(peek addrs) - peek at a location in memory
addrs - the address to peek at [integer]
returns - the value at the specified address [integer]

(poke addrs value) - poke a value into memory
addrs - the address to poke [integer]
value - the value to poke into the address [integer]
returns - the value

(address-of) - get the address of an XLISP node
expr - the node
returns - the address of the node [integer]

(system command) - execute a command of the operating system
command - the command to execute
returns - T if the command was successful, the error code otherwise

(exit) - exit XLISP
returns - never returns

XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next