Evaluation of the constant in EQL specializers now takes place in the lexical environment in which DEFMETHOD is enclosed.

This commit is contained in:
jjgarcia 2005-08-09 08:08:46 +00:00
parent 9052752e65
commit 3d1e56e0ec
2 changed files with 14 additions and 5 deletions

View file

@ -112,6 +112,10 @@ ECL 0.9g
- Variable SI::*GC-VERBOSE* controls whether ECL emits messages when FASL
libraries are garbage colleced.
- Values of EQL specializers are now evaluated in the lexical environment
in which the DEFMETHOD is enclosed. This makes it now possible to write
(defmethod foo (x) (defmethod bar ((f (eql x)))))
* ANSI compatibility:
- Several functions that signaled type-errors did not set the right values

View file

@ -53,7 +53,7 @@
(INSTALL-METHOD
',name
',qualifiers
',specializers
,(list 'si::quasiquote specializers)
',specialized-lambda-list
',doc
',plist
@ -456,10 +456,15 @@
arg))
(push (if (listp arg) (first arg) arg) parameters)
(push (if (listp arg) (first arg) arg) lambda-list)
(push (if (listp arg) (if (consp (second arg))
`(eql ,(eval (cadadr arg)))
(second arg))
())
(push (cond ((atom arg) '())
((atom (setf arg (second arg))) arg)
((not (eql (first arg) 'EQL))
(error 'simple-program-error
"Syntax error in method specializer ~A" arg))
((constantp (setf arg (second arg)))
`(eql ,arg))
(t
(list 'eql (list 'si::unquote arg))))
specializers))
(when (eq (first arglist) '&OPTIONAL)
(push (pop arglist) lambda-list)