KLSYS is sufficiently similar to Common LISP that some trivial programs may run without changes.
Like in Common LISP (CAR NIL) = (CDR NIL) = NIL and only NIL is false. The symbol T is used as a canonical truth value.
Like in Scheme, functions and variables share a common namespace. This means that no special operators are needed to call a function bound to a variable, but also that
((LAMBDA (LIST) (LIST LIST) 'FOO) ; BOOM
will not work. KLSYS is not a LISP-1, though; macros and catch tags are kept in separate namespaces, so
(CATCH FOO (LET ((FOO 'BAR)) (THROW FOO FOO)))
will work and return BAR.
Like Scheme KLSYS guarantees tail call optimization and encourages the use of tail recursive functions. When porting KLSYS programs to Common LISP, this may or may not cause trouble, depending on the Common LISP implementation.
Like in Scheme the argument list (FOO . BAR) will bind extra arguments too BAR, like (FOO &REST BAR) would in Common LISP (and just BAR would be equal to (&REST BAR)).
Like in Scheme the default case is lower case. Like in ancient LISP, special characters can be included in symbol names by slashifying them (placing a / character in front of them), e.g. /F/O/O.
The only numeric data type is the non-negative fixnum. Its range depends on compile time flags, the default range is 0 .. +224−1.
There is no condition system. Errors are handled by CATCH and THROW. When a program encounters an error condition, it will throw the tag PROGRAM-ERROR, which can be caught by a KLSYS program, thereby allowing to handle or ignore the error.
Most pre-defined functions are Common LISP-like. See the KLSYS reference manual for a summary of differences.
There is currently no package system. Symbols starting with KL− should not be used or defined unless documented in the reference manual.
contact | privacy