emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminology question


From: John Wiegley
Subject: Re: Terminology question
Date: Tue, 26 Apr 2016 10:48:49 -0400
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.93 (darwin)

>>>>> Jean-Christophe Helary <address@hidden> writes:

> I cannot find a clear definition of "form", "expression", "symbolic
> expression", "sexp" and whether the terms are equivalent or not.

A "form" is a piece of data in Lisp that represents a program, meaning it can
be evaluated without error.

  3       is a simple, self-evaluating form
  (3)     is not a form
  (+ 1 2) is a form

All of these are Lisp expressions, meaning sentences that are legal according
to the grammar of the Lisp language.

> So, are there lisp objects that cannot be evaluated ?

The list '(3) cannot be evaluated, as it will raise an exception about 3
having no definition as a function.

> There is no reference to "symbolic expression" in the Elisp Reference.

A symbolic expression is also called an s-expr, and represents the typical
form of Lisp data that we're used to seeing (here specified in simple BNF):

    sexpr : ATOM | cons
    cons  : (sexpr . sexpr)

In deep history there were also m-exprs (meta expressions), but these are no
longer used, and never were by Emacs Lisp to my knowledge.

> In the end it is not clear whether the terms are equivalent or not.

All forms are representable as s-exprs, but not all s-exprs represent forms.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]