[Ecls-list] Error with &key and defconstant defaults?
Dave Pearson
davep at davep.org
Fri May 23 03:09:01 UTC 2003
While playing with some code with ECL and other CL implementations I
happened across the following error and I'm not sure if this is "undefined
behaviour" resulting from a misunderstanding on my part or if this is an ecl
issue.
Here's a short body of code that demonstrates the problem:
,----[ test.lisp ]
| (defconstant +foo+ 23)
|
| (defconstant +bar+ 42)
|
| (defun test (&key (foo +foo+) (bar +bar+))
| (values foo bar))
`----
This code works fine with clisp, CMUCL, Allegro Common Lisp and Corman
Common Lisp. However, if I try and evaluate it with ecl 0.9 I get:
,----
| davep at hagbard:~/temp$ ecl
| ECL (Embeddable Common-Lisp) 0.9
| Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
| Copyright (C) 1993 Giuseppe Attardi
| Copyright (C) 2000 Juan J. Garcia-Ripoll
| ECL is free software, and you are welcome to redistribute it
| under certain conditions; see file 'Copyright' for details.
| Type :h for Help. Top level.
| > (load "test.lisp")
| ;;; Loading "test.lisp"
| #P"test.lisp"
| > (foo)
| The function FOO is undefined.
| Broken at EVAL.
| >>
`----
Am I trying to do something that ECL doesn't permit or could this be a bug
in ECL?
--
Dave Pearson
http://www.davep.org/lisp/
More information about the ecl-devel
mailing list