Topics in this section:
Basics (type predicates, symbol handling, printing)
Basics: (type predicates, symbol handling, printing)
(FUNCTION expr) ; same as quote. needed for compilers.
(STD-FUNCTIONP expr) ; is it a function?
(STD-SYMBOLP expr) ; is it a symbol?
(STD-INTEGERP expr) ; is it a integer number?
(STD-REALP expr) ; is it a real number?
(STD-FILEP expr) ; is it a file object?
(STD-OPEN-FILE-P file) ; is it a not closed file?
(STD-SYMBOL-VALUE sym) ; fast eval for symbols only
(STD-SYMBOL-NAME sym) ; symbol->string conversion
(STD-GENSYM) ; create a new unbound symbol
(STD-PRINC expr) ; takes also lists
(STD-PRINC-TO expr file ; std-princ extended for files
(STD-PRINC-TO-STRING sym) ; accepts any expression
(STD-PRIN1-TO-STRING sym) ; as prin1, escaped characters
(STD-TOSTR expr) ; user-friendly std-princ-to-string
Comparison
(STD-EQUALP x1 x2) ; for sets and more types, weaker than equal
*PRINT-LENGTH* ; max. printed list length
*PRINT-LEVEL* ; max. printed tree depth
*LOAD-VERBOSE* ; print load messages?
*VERBOSE* ; controls degree of verbosity
*DEBUG* ; enable debugging?
*BREAK* ; enable break?
*BREAK-ON-WARNINGS* ; interrupt (alert) on std-warn?
*GENSYM-COUNTER* ; actual gensym number (internal)
Errors, Debugging: see also STDERROR
(STD-VERBOSE-PRINT msg) ; princ if *VERBOSE*
(STD-DEBUG-PRINT msg) ; princ if *DEBUG*
(STD-WARN msg) ; may break or just prints msg
(STD-PRINT-WARN msg) ; just prints msg
(STD-ERROR msg) ; breaks with error message
(STD-CERROR msg) ; continuable error
(STD-ASSERT test msg) ; throw error if test=>nil
(STD-PRINT-ERRNO [errno]) ; prints related error message
(STD-DEFCONSTANT 'sym value) ; protect assign it with VL
(STD-DEFKEYWORD 'sym) ; create a self-evaluating contant symbol
(STD-KEYWORDP sym) ; is it a keyword, starting with a colon?
(STD-DEFAULT 'sym def) ; if nil set sym to def
(STD-DEFAULT-TYPE 'sym def) ; if not of type def set sym to def
(STD-PROVIDE str|sym) ; define a module
(STD-REQUIRE str|sym) ; loads a module if necessary
(STD-REQUIRE-PATH module path) ; module with explicit pathname
(STD-MODULE-PATHNAME str|sym) ; filename
(STD-REQUIRE-VERSION str|sym version) ; loads a module if necessary or to old.
*MODULE-PATH* ; list of pathnames which are searched for modules before the Acad library path.
*STD:%PROJECT* Magic variable which controls module delaying
*DELAYED-MODULES* List of delayed modules
(STD-MODULES) ; => list of loaded modules
(STD-MODULE-DEFINED-P str|sym) ; T if defined
(STD-MODULE-UNBIND str|sym) ; undefines a module and some symbols.
see pro's and contras deleting symbols
Debugging and Testing: (STDDEBUG)
*DEBUG* ; enable debugging?
*BREAK* ; enable break?
(STD-DEBUG-PRINT msg) ; princ if *DEBUG*
(STD-CERROR msg) ; continuable error
(STD-BREAK msg vars) ; continuable halt and variable inspector
*TIMER-FORMAT-STRING* ; controls output of STD-TIME
(STD-TIME func) ; print used resources
Lisp typical constructs, dealing with symbols, errors and various others. Lisp is a symbolic language but some basic functions were omitted.
Recoverable error handling (also called exception handling or condition handling system) is not possible, but for simple debugging these functions should be enough.
Modules allow to define dependencies between various lisp files.
Error handling (restauring system settings) is covered by the module STDERROR, which is described with STDINIT