This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
| Lispkit Lisp | |
|---|---|
| Paradigm | pure functional |
| Family | Lisp |
| Designed by | Peter Henderson |
| First appeared | 1980; 46 years ago (1980) |
| Scope | lexical |
| Implementation language | ALGOL |
| Influenced by | |
| ALGOL,Lisp | |
Lispkit Lisp is alexically scoped,purely functional subset ofLisp (Pure Lisp) developed as a testbed forfunctional programming concepts. It was first used for early experimentation withlazy evaluation. An implementation based on astack, environment, control, dumpvirtual machine andabstract machine (SECD machine) written in anALGOL variant was published by the developer Peter Henderson in 1980.[1] Thecompiler andvirtual machine are highlyportable and as a result have been implemented on many machines.[2][3]
The base language provides the following functions only but extensions are discussed in Henderson's book[1] for the explicit support of lazy evaluation andnondeterministic programming.
atom – given an expression returns True if its value is atomic; False if notadd – given two expressions returns the sum of their numeric valuescar – given an expression whose value is a pair, returns the pair's first valuecdr – given an expression whose value is a pair, returns the pair's second valuecons – given two expressions returns a value pair consisting of their valuesdiv – given two expressions returns the quotient of their numeric valueseq – given two expressions returns True if their values are equal; False if notif – given three expressions returns the value of the second if the value of the first is True, otherwise returns the value of the thirdlambda – given an argument list and an expression, returns them as a functionlet – given an expression with declarations (as named expressions visible in the expression) returns its valueletrec – like let, except the declared names are also visible in the declarations themselvesleq – 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 notmod (orrem) – given two expressions, returns the modulus (also known as the remainder) of their numeric valuesmul – given two expressions, returns the product of their numeric valuesquote – given an expression, returns that expression as a valuesub – given two expressions, returns the difference of their numeric valuesThe functions,lambda,let, andletrec, 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, andletrec is essentially similar tolet except it allows defining ofrecursive functions and values, e.g.,infinite series.