[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Unbound variable



Jacques Duthen,

Regarding your question on:

      Welcome to Macintosh Common Lisp Version 2.0b1!
      ? (foo x)
      > Error: Unbound variable: X
      > While executing: SYMBOL-VALUE
      Is it normal?

Yes it is normal. When you hit the return key the read-eval-print loop takes
over. Before any arguments are passed to the function or macro they are
evaluated. Since your x was unbound an error had to be generated. If you had x
bound, it would have been evaluated and that value would have been assigned to
the function or marco parameter.

     This is particularly ennoying when *in my mind* foo is a macro or
special-form:
     ? (defub bar ())
     > Error: Unbound variable: BAR
     > While executing: SYMBOL-VALUE


Before macro expansion can take place it must have valid parameter values. If
it didn't it would expand in to an unstable form.

Sincerly,

Lou