Lispkit Lisp is a lexically scoped, purely functional subset of Lisp (Pure Lisp) developed as a testbed for functional programming concepts. It was first used for early experimentation with lazy evaluation. An implementation based on a stack, environment, control, dump virtual machine and abstract machine (SECD machine) written in an ALGOL variant was published by the developer Peter Henderson in 1980. The compiler and virtual machine are highly portable and as a result have been implemented on many machines.
Base language
The base language provides the following functions only but extensions are discussed in Henderson's book for the explicit support of lazy evaluation and nondeterministic programming.
<code>atom</code> â given an expression returns True if its value is atomic; False if not
<code>add</code> â given two expressions returns the sum of their numeric values
<code>car</code> â given an expression whose value is a pair, returns the pair's first value
<code>cdr</code> â given an expression whose value is a pair, returns the pair's second value
<code>cons</code> â given two expressions returns a value pair consisting of their values
<code>div</code> â given two expressions returns the quotient of their numeric values
<code>eq</code> â given two expressions returns True if their values are equal; False if not
<code>if</code> â given three expressions returns the value of the second if the value of the first is True, otherwise returns the value of the third
<code>lambda</code> â given an argument list and an expression, returns them as a function
<code>let</code> â given an expression with declarations (as named expressions visible in the expression) returns its value
<code>letrec</code> â like let, except the declared names are also visible in the declarations themselves
<code>leq</code> â given two expressions, returns True if the value of the first is numerically less than or equal to the value of the second; False if not
<code>mod</code> (or <code>rem</code>) â given two expressions, returns the modulus (also known as the remainder) of their numeric values
<code>mul</code> â given two expressions, returns the product of their numeric values
<code>quote</code> â given an expression, returns that expression as a value
<code>sub</code> â given two expressions, returns the difference of their numeric values
The functions, <code>lambda</code>, <code>let</code>, and <code>letrec</code>, are similar but have subtle differences in the way that they treat named variables which make them useful in different ways: <code>lambda</code> defines and returns a function, <code>let</code> binds expressions to variable names, and <code>letrec</code> is essentially similar to <code>let</code> except it allows defining of recursive functions and values, e.g., infinite series.
References
Further reading
External links