[Haskell-cafe] Language simplicity

Matthias Görgens matthias.goergens at googlemail.com
Thu Jan 14 09:42:06 EST 2010

> All Lisps have "special forms" which are evaluated uniquely and differently from function application and are therefore reserved words by another name. For example, Clojure has def, if, do, let, var, quote, fn, loop, recur, throw, try, monitor-enter, monitor-exit, dot, new and set!.

Yes, but the special forms are not distinguishable from user defined
macros --- and some Lisp-implemantations special forms are another
implementations macros.  E.g. you can choose to make `if' a macro that
expands to `cond' or vice versa.  I do not know whether you are
allowed to shadow the name of special-forms.

> If you count reserved tokens, I guess Lisp reserves parentheses and whitespace?

Not if you are using Common Lisp.  There you can install reader-macros
that act on characters in the input-stream.  (Most macros act on stuff
in the already parsed syntrax tree.)

Forth is also a remarkably flexible language in this regard.


More information about the Haskell-Cafe mailing list