http://t3x.org/klisp/klsys/kl-cl-scheme.html

KLSYS compared to Common LISP and Scheme

KLSYS is sufficiently similar to Common LISP that some trivial programs may run without changes.

NIL, True, and False

Like in Common LISP (CAR NIL) = (CDR NIL) = NIL and only NIL is false. The symbol T is used as a canonical truth value.

Namespaces

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.

Tail Recursion

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.

Rest Arguments

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)).

Symbol Names

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.

Numeric Data Types

The only numeric data type is the non-negative fixnum. Its range depends on compile time flags, the default range is 0 .. +224−1.

Error Handling

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.

Built-In Functions

Most pre-defined functions are Common LISP-like. See the KLSYS reference manual for a summary of differences.

Package System

There is currently no package system. Symbols starting with KL− should not be used or defined unless documented in the reference manual.


contact  |  privacy