MLisp
Encyclopedia
- "MLisp" is also another name for MocklispMocklispMocklisp is the extension language of Gosling Emacs. While resembling Lisp in many ways, it is semantically quite different. Richard Stallman characterized it as a programming language that "looks syntactically like Lisp, but didn't have the data structures of Lisp. So programs were not data, and...
, a stripped-down version of Lisp used as an extension language in Gosling EmacsGosling EmacsGosling Emacs was an Emacs implementation written in 1981 by James Gosling in C. Its extension language, Mocklisp, has a syntax that appears similar to Lisp, but Mocklisp does not have lists or any other structured datatypes...
.
MLISP is a variant of Lisp
Lisp programming language
Lisp is a family of computer programming languages with a long history and a distinctive, fully parenthesized syntax. Originally specified in 1958, Lisp is the second-oldest high-level programming language in widespread use today; only Fortran is older...
with an Algol
ALGOL
ALGOL is a family of imperative computer programming languages originally developed in the mid 1950s which greatly influenced many other languages and became the de facto way algorithms were described in textbooks and academic works for almost the next 30 years...
-like syntax based on M-Expressions
M-expression
In computer programming, M-expressions were intended to be the expressions used to write functions in the Lisp programming language. Data to be manipulated using M-expressions was to be written using S-expressions...
, which were the function syntax in the original description of Lisp by John McCarthy
John McCarthy (computer scientist)
John McCarthy was an American computer scientist and cognitive scientist. He coined the term "artificial intelligence" , invented the Lisp programming language and was highly influential in the early development of AI.McCarthy also influenced other areas of computing such as time sharing systems...
. McCarthy's M-expressions were never implemented.
MLISP was first implemented for the IBM 360 by Horace Enea and then reimplemented for the PDP 10 by David Canfield Smith. This second implementation also supported a special kind of lambdas ("FEXPR
Fexpr
In Lisp programming languages, a fexpr is a function whose operands are passed to it without being evaluated. When a fexpr is called, only the body of the fexpr is evaluated; no other evaluations take place except when explicitly initiated by the fexpr...
"), which do not evaluate their arguments . As in Lisp-1 or Scheme, there was a single namespace for variables and functions.
While MLISP was just a preprocessor with an alternative, more reader-friendly syntax for Lisp, the descendant MLISP 2 introduced new concepts:
- interactive interpretation of programs instead of compilation
- extensibility with a syntax description language (see hygienic macroHygienic macroHygienic macros are macros whose expansion is guaranteed not to cause collisions with existing symbol definitions. They are a feature of programming languages such as Scheme and Dylan.-The hygiene problem:...
s) - pattern matchingPattern matchingIn computer science, pattern matching is the act of checking some sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact. The patterns generally have the form of either sequences or tree structures...
- backtrackingBacktrackingBacktracking is a general algorithm for finding all solutions to some computational problem, that incrementally builds candidates to the solutions, and abandons each partial candidate c as soon as it determines that c cannot possibly be completed to a valid solution.The classic textbook example...
by the use of closureClosure (computer science)In computer science, a closure is a function together with a referencing environment for the non-local variables of that function. A closure allows a function to access variables outside its typical scope. Such a function is said to be "closed over" its free variables...
s on a stack and indices for continuationContinuationIn computer science and programming, a continuation is an abstract representation of the control state of a computer program. A continuation reifies the program control state, i.e...
s
MLISP2 was called a transitional language by the authors. Larry Tesler
Larry Tesler
Larry Tesler is a computer scientist working in the field of human-computer interaction. Tesler has worked at Xerox PARC, Apple Computer, Amazon.com, and Yahoo!...
improved the pattern matching system to implement a successor language called LISP70, which was only completed to a preliminary version. Though this path of LISP evolution is widely neglected, it resembles some features, later found in ML or Scheme.
M-LISP is a second branch — independent from the MLISP approach — and, as described by the author, essentially a hybrid of M-expression
M-expression
In computer programming, M-expressions were intended to be the expressions used to write functions in the Lisp programming language. Data to be manipulated using M-expressions was to be written using S-expressions...
LISP and Scheme.