Search code examples
lisps-expression

What does the M-expression list[x;y] do in LISP?


I was reading this paper on LISP by McCarthy (way above my skill set). While defining the evaluation of (LABEL, f, e) here, he used an M-expression (I think it's an M-expression, correct me if I am wrong) list[x;y]. {Actually, list[cadar[e];car[e]]}.

According to how I understood it, it symbolizes (e1, e2) where e1 and e2 are S-expressions. Did I get it right or is it something else, and what is the corresponding expression for list[x;y]?

Thank you.


Solution

  • In the metalanguage, the expression list[a; b] denotes the application of the function list to two arguments, which builds a list with two elements, which are the result of the evaluation of a and b respectively.

    In the language of the S-expressions, so, this would be written as the usual function call: (LIST a b), that is a list with the first element the name of the function (LIST) and the rest of the elements the actual parameters of the function. Note that here I use the notation (a b) for S-expressions, and not (a, b). McCarthy itself changed this notation later, and in the LISP 1.5 Programmer’s Manual. 2. ed. Cambridge, Mass: MIT Pr, 1979. the new notation is used.