Lispkit Lisp

Lispkit Lisp

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. 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 non-deterministic programming.

;atom: given an expression returns True if its value is atomic; False if not.;add: given two expressions returns the sum of their numeric values.;car: given an expression whose value is a pair, returns the pair's first value.;cdr: given an expression whose value is a pair, returns the pair's second value.;cons: given two expressions returns a value pair consisting of their values.;div: given two expressions returns the dividend of their numeric values.;eq: given two expressions returns True if their values are equal; False if not.;if: given three expressions returns the value of the second if the value of the first is True, otherwise returns the value of the third.;lambda: given an expression, returns that expression as an evaluable value.;let: given a list of named expressions, returns that list as a single evaluable value.;letrec: given a list of named expressions, returns that list as a single evaluable value.;leq: 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.;rem: given two expressions, returns the remainder of their numeric values.;mul: given two expressions, returns the product of their numeric values.;quote: given an expression, returns that expression as a value.;sub: 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" assigns expressions to variable names, and "letrec" is essentially similar to "let" except it allows for the definition of recursive functions.

Further reading

*Peter Henderson, "Functional Programming: Application and Implementation", 1980, Prentice Hall (ISBN 0-13-331579-7)
*Peter Henderson, Geraint A. Jones, and Simon B. Jones, "The LispKit Manual" (ISBN 0-902928-18-X)

External links

*http://lispkit.members.beeb.net/ - New GNU Pascal LispKit port.
*http://www.cs.uml.edu/~giam/DPL/Code/lispkit/LKIT-2/ - Archive of old LispKit LISP code and files.
*http://perun.im.ns.ac.yu/radovanovic/publications/2002-prim-lisp.pdf - Paper about a LispKit LISP implementation in Java.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Comparison of application virtual machines — This article lists some software virtual machines that are typically used for allowing application bytecode to be portably run on many different computer architectures and operating systems. The application is usually run on the computer using an …   Wikipedia

  • SECD machine — The SECD machine is a highly influential virtual machine intended as a target for functional programming language compilers. The letters stand for Stack, Environment, Code, Dump, the internal registers of the machine. These registers point to… …   Wikipedia

  • Virtual machine — A virtual machine (VM) is a completely isolated guest operating system installation within a normal host operating system .[1] Modern virtual machines are implemented with either software emulation or hardware virtualization or (in the most… …   Wikipedia

  • Máquina virtual — Arquitectura típica de una máquina virtual. VirtualBox …   Wikipedia Español

  • SECD-Maschine — Die SECD Maschine ist eine virtuelle Maschine, die als Zielarchitektur für Compiler funktionaler Programmiersprachen gedacht ist. Die Buchstaben stehen für Stack, Environment, Code, Dump, welches die internen Register der Maschine sind. Diese… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”