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

Re: Error: Unbound variable or undefined function ?

In article <1991Aug1.082008.17363@ircam.fr> duthen@ircam.fr (Jacques Duthen) writes:
>Here is a session I got:
>Welcome to Macintosh Common Lisp Version 2.0b1!
>? (foo x)
>> Error: Unbound variable: X
>> While executing: SYMBOL-VALUE
>Is it normal?
>I mean: Does CLtL recommand to evaluate the arguments of a function *BEFORE*
>testing if the function is defined ?

CLtL didn't address this at all.  X3J13 has addressed this omission by
explicitly specifying that the order is undefined; this is in CLtL2.  Of
course, it does have to evaluate the function name enough to determine
whether it names a macro or special form before evaluating the arguments.

An implementation that tests whether the function is defined after
evaluting the arguments permits the following obscure type of construct:

(foo (defun foo ...))

This is not portable, nor would I ever recommend programming like this, but
the implementor may have obscure reasons why he feels it is necessary to
support this.

In any case, there didn't seem to be any important reason why the standard
should specify the order, since it's not a good idea for programs to depend
on it and implementations already differed.

Barry Margolin, Thinking Machines Corp.