News for hackers. Stuff that matters.
Re:An Intuition for Lisp Syntax (2020) by lispm on Monday August 29, 2022 @02:18AM (#32635260)
Lisp has quite a bit more syntax, since it has a two stage syntax. The first stage is a syntax for data, called s-expressions. The parentheses are a part of that data syntax. Examples for s-expressions:

  12
  1/3
  rome
  (rome is a city in italy)
  (rome (city . italy) (capital-of italy))
  (rome local-name "Roma")
   
and more. The s-expression syntax is extensible via reader macros.

Lisp programs then are made out of s-expressions and there is a syntax for Lisp. Additionally the Lisp syntax is extensible via macros.

Example:

  (let ((a 10)
        (b 10))
    (declare (integer a b))
    (+ a b))
Above is a LET expression for spanning a local lexical scope for variables.

The syntax for LET would be (in some kind of EBNF notation):

  let ({var | (var [init-form])}*)
   declaration*
   form*
With then more syntax for DECLARATION, FORM, ...

There are no comments on this comment yet.