In computer programming, Mexpressions (or metaexpressions) were an early proposed syntax for the Lisp programming language, inspired by contemporary languages such as Fortran and ALGOL. The notation was never implemented into the language and, as such, it was never finalized.^{[1]}
Compared to Sexpressions, Mexpressions introduce function notation, infix operators (including a defun
operator), and shorthands for cond
and list
into the language.^{[2]}
John McCarthy published the first paper on Lisp in 1960 while a research fellow at the Massachusetts Institute of Technology. In it he described a language of symbolic expressions (Sexpressions) that could represent complex structures as lists. Then he defined a set of primitive operations on the Sexpressions, and a language of metaexpressions (Mexpressions) that could be used to define more complex operations. Finally, he showed how the metalanguage itself could be represented with Sexpressions, resulting in a system that was potentially selfhosting.^{[3]} The draft version of this paper is known as "AI Memo 8".^{[4]}
Expression type  Mathematical notation  Mexpression  Modern Lisp Sexpression 

List value  [1;2;3]

(quote (1 2 3))
 
Function application  f[x;y]

(f x y)
 
Function definition  label[square;λ[[x];times[x;x]]]

(define square (lambda (x) (* x x)))
 
Conditional expression  [lessp[x;0] → minus[x]; T → x]

(cond ((< x 0) ( x)) (t x))

McCarthy had planned to develop an automatic Lisp compiler (LISP 2) using Mexpressions as the language syntax and Sexpressions to describe the compiler's internal processes. Stephen B. Russell read the paper and suggested to him that Sexpressions were a more convenient syntax. Although McCarthy disapproved of the idea, Russell and colleague Daniel J. Edwards handcoded an interpreter program that could execute Sexpressions.^{[2]} This program was adopted by McCarthy's research group, establishing Sexpressions as the dominant form of Lisp.
McCarthy reflected on the fate of Mexpressions in 1979:
The project of defining Mexpressions precisely and compiling them or at least translating them into Sexpressions was neither finalized nor explicitly abandoned. It just receded into the indefinite future, and a new generation of programmers appeared who preferred internal notation to any FORTRANlike or ALGOLlike notation that could be devised.^{[5]}
A form of sugared Mexpressions has been implemented in the Wolfram language of Wolfram Mathematica since 1988:
Expression type  Sugared syntax (InputForm)  Function form (FullForm)  

List value  {1, 2, 3}

List[1, 2, 3]
 
Function application  f[x, y]

f[x, y]
 
Function definition  pure  square = #*# &

Set[square, Function[Times[Slot[1],Slot[1]]]]

named  square = x ↦ x*x

Set[square, Function[x, Times[x, x]]]
 
pattern  square[x_] := x*x

SetDelayed[square[Pattern[x, Blank[]]], Times[x, x]]
 
Conditional expression^{[note 1]}

If[x<0,x,x]

Piecewise[((x, x < 0)), x]

MLisp was a contemporary (1968–1973) project to implement an Mexpressionlike frontend for Lisp. A few extra features like hygienic macros, pattern matching, and backtracking were incorporated. It eventually evolved into an abandoned LISP70 draft. MLISP (MetaLISP) from 1989 was another attempt to blend Mexpressions with Scheme.^{[7]}
A parser for the "AI Memo 8" Mexpression is available in Common Lisp, but the author intends it as a case against Mexpressions due to its perceived inability to cope with macros.^{[8]}
The K (programming language) also includes MExpressions, in addition to the more terse notation in the APLtradition.
fibs: {[n]
if[less[n;3];:iota[n]]
fibrec:{[list]
if[equal[n;count[list]];:list]
a:list[minus[count[list];1]]
b:list[minus[count[list];2]]
:_f[join[list;plus[a;b]]]
}
:fibrec[(0;1)]
}
A CGOL (1977) was implemented in MacLisp and follows a similar goal of introducing Algollike syntax with infix operators.^{[7]} It is known to work on Armed Bear Common Lisp.^{[9]}
A more recent (circa 2003) variant is the Iexpression, which use indentation to indicate parentheses implicitly, and are thus in some ways intermediate between Sexpressions and Mexpressions. Iexpressions were introduced in Scheme Request For Implementation 49 as an auxiliary syntax for Scheme, but they have not been widely adopted.^{[10]}
A further development is the "sweet" texpression, which has infix operators without precedence. Like Iexpressions, texpressions are only a simple transformation away from Sexpressions, so that theoretically they can be used on any Lisp dialect and not interfere with features like macros.^{[11]}
Additional syntaxrelated include Apple's Dylan (Algollike tokens) and Clojure's addition of other literal syntaxes.^{[7]}