common-lisp ANSI Common Lisp, the language standard and its documentation EBNF syntax declarations in documentation


Example

The ANSI CL standard uses an extended EBNF syntax notation. The documentation duplicated on Stackoverflow should use the same syntax notation to reduce confusion.

Example:

specialized-lambda-list::=
     ({var | (var parameter-specializer-name)}* 
      [&optional {var | (var [initform [supplied-p-parameter] ])}*] 
      [&rest var] 
      [&key{var | ({var | (keywordvar)} [initform [supplied-p-parameter] ])}*
           [&allow-other-keys] ] 
      [&aux {var | (var [initform] )}*] ) 

Notation:

  • [foo] -> zero or one foo
  • {foo}* -> zero or more foo
  • foo | bar ->foo or bar