Re:M-expressions==LISP in "normal syntax"-kills LISP?
by jcl on Wednesday May 21, 2008 @02:51PM
(#196399)
Unless I'm missing something, M-expressions as expressed in the Wikipedia article are an alternate syntax for S-expressions; all the examples therein have the same number of parentheses/brackets in either syntax, so I don't think those M-expressions will save you many parentheses.
That said, you really only need parentheses (or other grouping operators) in situations where you don't know how many arguments there are; in most function calls, for instance, you know exactly how many parameters are needed, so the parentheses can be eliminated. This is effectively how Logo and Forth work.
However, eliminating parentheses in this manner means that the syntax tree interpretation of any given code depends on the function definitions currently in memory -- which is not the case with Lisp code, whose structure is explicit. I assume this would complicate a macro system.
That said, you really only need parentheses (or other grouping operators) in situations where you don't know how many arguments there are; in most function calls, for instance, you know exactly how many parameters are needed, so the parentheses can be eliminated. This is effectively how Logo and Forth work.
However, eliminating parentheses in this manner means that the syntax tree interpretation of any given code depends on the function definitions currently in memory -- which is not the case with Lisp code, whose structure is explicit. I assume this would complicate a macro system.