I am currently working my way through Graham's On Lisp and find this particular bit difficult to understand:
Binding. Lexical variables must appear directly in the source code. The first argument to
setq
is not evaluated, for example, so anything built onsetq
must be a macro which expands into asetq
, rather than a function which calls it. Likewise for operators likelet
, whose arguments are to appear as parameters in a lambda expression, for macros like do which expand intolet
s, and so on. Any new operator which is to alter the lexical bindings of its arguments must be written as a macro.
This comes from Chapter 8, which describes when macros should and should not be used in place of functions.
What exactly does he mean in this paragraph? Could someone give a concrete example or two?
Much appreciated!
let
do not appear in a lambda expression, for instance. What? – Mcnair