Lispkit Lisp

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

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 SECD machine-based implementation written in an ALGOL variant was published by the developer Peter Henderson in 1980.[1] The compiler and virtual machine are highly portable and as a result have been implemented on many machines.

Base language[edit]

The base language provides the following functions only but extensions are discussed in Henderson's book[1] for the explicit support of lazy evaluation and non-deterministic programming.

given an expression returns True if its value is atomic; False if not.
given two expressions returns the sum of their numeric values.
given an expression whose value is a pair, returns the pair's first value.
given an expression whose value is a pair, returns the pair's second value.
given two expressions returns a value pair consisting of their values.
given two expressions returns the dividend of their numeric values.
given two expressions returns True if their values are equal; False if not.
given three expressions returns the value of the second if the value of the first is True, otherwise returns the value of the third.
given an argument list and an expression, returns them as a function.
given an expression with declarations (as named expressions visible in the expression) returns its value.
like let, except the declared names are also visible in the declarations themselves.
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.
mod (or rem)
given two expressions, returns the modulus (also known as the remainder) of their numeric values.
given two expressions, returns the product of their numeric values.
given an expression, returns that expression as a value.
given two expressions, returns the difference of their numeric values.

The functions, lambda, let, and letrec, are similar but have subtle differences in the way that they treat named variables which make them useful in different ways. lambda defines and returns a function, let binds expressions to variable names, and letrec is essentially similar to let except it allows for the definition of recursive functions and values, e.g., infinite series.


  1. ^ a b Henderson, Peter (1980). Functional Programming: Application and Implementation. Prentice Hall. ISBN 0-13-331579-7.

Further reading[edit]

  • Henderson, Peter; Jones, Geraint A.; Jones, Simon B. (1983). The LispKit Manual. University of Oxford Computing Lab. ISBN 0-902928-18-X.

External links[edit]