bug in optional argument processing (?)

Ralf Juengling <[email protected]> Thu, 23 Mar 2006 17:33:08 -0800 (PST)
Newsgroups gmane.lisp.lush.devel
Message-ID <[email protected]>
Here is what Lush does:

? (defparameter *global-val* 5)
= *global-val*
? (defun f (val &optional (other-val *global-val*))
     (+ val other-val))
= f
? (f 12)

*** + : not a real number : *global-val*
Debug toplevel [y/N] ?n
?



Here is what CLisp does:

[1]> (defparameter *global-val* 5)
*GLOBAL-VAL*
[2]> (defun f (val &optional (other-val *global-val*))
        (+ val other-val))
F
[3]> (f 12)
17
[4]> (defparameter *global-val* 0)
*GLOBAL-VAL*
[5]> (f 12)
12
[6]>





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642