[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error: Unbound variable or undefined function ?
- To: info-mcl
- Subject: Re: Error: Unbound variable or undefined function ?
- From: email@example.com (Barry Margolin)
- Date: 2 Aug 91 05:54:47 GMT
- Newsgroups: comp.lang.lisp, comp.lang.lisp.mcl
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- References: <1991Aug1.firstname.lastname@example.org>
- Reply-to: email@example.com
- Sender: news@Think.COM
In article <1991Aug1.firstname.lastname@example.org> email@example.com (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
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.