3 ms·
Macros implement syntax and semantics. Arbitrary complex syntax. Check out the complex syntax for DEFGENERIC, DEFCLASS, DEFSTRUCT, defpackage ... LOOP The synt
by lispm 11y ago
Macros implement syntax and semantics. Arbitrary complex syntax. Check out the complex syntax for DEFGENERIC, DEFCLASS, DEFSTRUCT, defpackage ... LOOP
The syntax for DEFUN in Common Lisp:
defun function-name lambda-list [[declaration* | documentation]] form*
The syntax for lambda-list then is:
lambda-list::= (var*
[&optional {var | (var [init-form [supplied-p-parameter]])}*]
[&rest var]
[&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}* [&allow-other-keys]]
[&aux {var | (var [init-form])}*])
Lisp syntax is not atom | '(' atom* ')'. It's much more complex.
And so on.
Every Lisp has arbitrary complex syntax due to macros and special operators.