Lisp uses s-expressions. There is a long history of others that have been tried.
- 1958 - M-expressions, Lisp's original intended syntax (never implemented)
- 1964 - A-Language, algol syntax for LISP
- 1964 - LISP 2, algol syntax (proposal)
- 1967 - Logo, educational lisp (no outer parens, square brackets for inner nesting)
- 1967 - Interlisp, added optional "Super Parentheses" for replacing
)))))...
with]
- 1968 - MLISP, algol syntax for LISP 1.5
- 1970 - RLISP, algol syntax for Standard LISP
- 1973 - CLISP, Conversational LISP (s-expressions + infix/algol)
- 1977 - CGOL, algol syntax for MACLISP
- 1992 - Dylan, lisp derivative with algol syntax
- 1996 - IACL2, infix support for ACL2, a Common Lisp variant
- 1997 - Pico, an educational Scheme with easier syntax
- 2003 - I-expressions, indentation-based
- 2006 - PLOT, macro-compatible algol-like
- 2006 - TwinLisp, C-like syntax for Common Lisp
- 2006 - Readable, proposing three superset (c,n,t)-expressions
- 2008 - Genyris, indentation-based
- 2009 - Ginger, proposing g-expressions for "python aesthetics" (backup link)
- 2012 - Honu, similar to PLOT, macro-compatible (backup link)
- 2014 - Wisp, a simplified version of "readable"
- 2015 - Nonelang, with naked expressions
"Although LISP is one of the most powerful tools available ... the format of the input language (S-expression) is awkward to use -- so awkward that many errors in programming LISP stem directly from the fact that S-expressions are the only allowable form of input. The inherent difficulty of producing correctly working S-expressions is tacitly recognized by anyone who uses M-expressions in place of them, when not communicating directly with the computer." "... This simple function has 26 parentheses, and a long complicated program would have many more. This proliferation of parentheses makes it very difficult to write such complicated programs without an error in placement or pairing of parentheses." "Another inconvenience is the fact that Polish notation is mandatory... All this points toward the need for a more natural input language."
> —An Auxiliary Language for More Natural Expression—the A-Language (1964)
"The syntax of [Lisp] is very simple, in the sense that it can be described concisely, but not in the sense that Lisp programs are easy to read or write! This simplicity of syntax is achieved by, and at the expense of, extensive use of explicit structuring, namely, grouping through parenthesization." "... most high level programming languages offer syntactic devices for reducing apparent depth and complexity of a program: the reserved words and infix operators used in Algol-like languages simultaneously delimit operands and operations, and also convey meaning to the programmer. They are far more intuitive than parentheses. In fact, since Lisp uses parentheses (i.e., lists) for almost all syntactic forms, there is very little information contained in the parentheses for the person reading a Lisp program, and so the parentheses tend mostly to be ignored: the meaning of a particular Lisp expression for people is found almost entirely in the words, not in the structure."
> —Conversational Lisp (1973)
A-Language allowed function calls delimited by custom word positions rather than parens. An example definition:
(DEFINE
SUBSTITUTING ; name
(THE RESULT OF FOR IN) ; auxiliary words to discard
(7) ; precedence level
(THE RESULT OF SUBSTITUTING X FOR Y IN Z) ; example that locates the args relative to the name and auxiliary words to be discarded
(SUBST X Y Z)) ; body definition
An example usage of the above definition:
(IF
THE RESULT OF SUBSTITUTING X FOR Y IN Z ; <- calls above definition
EQUALS Z
THEN PRINT Z ELSE X)
Just as communication is based on the intention of the speaker to produce an effect in the recipient, Clisp operates under the assumption that what the user said was intended to represent a meaningful operation, and therefore tries very hard to make sense of it.
Clisp embraces the natural ambiguity of human communication as a virtue. It is simply a system that receives errors from the normal interpreter and tries to resolve them depending on the types of values attached to names. Specifically, it claims to be able to take errors resulting from infix notation and algol-style function calls and translate them appropriately.
See The Portable Standard LISP Users Manual, Chapter 3
- Readable s-expressions and sweet-expressions...(2006)
- later expanded into a large wiki resources and history
- Top Down Operator Precedence (2007)
- The Evolution of Lisp (1993)
- LISP Infix Syntax Survey (2013)
- lispin.org similar links
- 2008 - Lisp Flavored Erlang
- 2013 - Hylang
I can't tell how close Mathematica (Wolfram Language) is to Lisp. Some
evaluation differences, and f[...]
for function calls, {...}
for lists,
and (...)
for grouping.