[Ecls-list] symbol-macro usage
Alexander Gavrilov
angavrilov at gmail.com
Tue Feb 16 20:20:38 UTC 2010
Hi, I just want to remind that the following two
CLOS-related bugs are rather serious:
> --- a/src/clos/method.lsp
> +++ b/src/clos/method.lsp
> @@ -103,7 +103,7 @@
> (when in-closure-p
> (setf plist '(:needs-next-method-p FUNCTION))
> (setf real-body
> - `((let* ((.combined-method-args.
> + `((let* ((.closed-combined-method-args.
> (locally (declare (special .combined-method-args.))
> (if (listp .combined-method-args.)
> .combined-method-args.
> @@ -113,7 +113,7 @@
> (unless .next-methods.
> (error "No next method"))
> (funcall (car .next-methods.)
> - (or args .combined-method-args.)
> + (or args .closed-combined-method-args.)
> (rest .next-methods.)))
> (next-method-p ()
> .next-methods.))
>
> Rationale: Fix the call-next-method closure
> (.combined-method-args. is now globally special)
; Reproduced with:
(defgeneric foo (a b)
(:method ((x function) b)
(funcall x)))
(defgeneric bar (a b)
(:method (a b)
(print (list a b)))
(:method ((a integer) b)
(foo #'call-next-method b)))
> --- a/src/clos/kernel.lsp
> +++ b/src/clos/kernel.lsp
> @@ -373,7 +373,7 @@
> (loop for type in spec-how-list
> for name in (generic-function-lambda-list gf)
> for i from 0
> - when type collect (cons type (position name a-p-o))))
> + when type collect (cons type i)))
> (let* ((g-f-l-l (generic-function-lambda-list gf)))
> (when (consp g-f-l-l)
> (let ((required-arguments (rest (si::process-lambda-list g-f-l-l t))))
>
> Rationale: Fix the generic function method cache in presense of
> argument-precedence-order and (eql) methods.
> Try experimenting with the following definition:
; Some experimenting with this function shows that
; the results are completely bogus:
(defgeneric zzz (a b c)
(:argument-precedence-order b c a)
(:method (a b c)
(print (list a b c)))
(:method ((a t) (b (eql 'foo)) c)
(print "foo")))
This one, of course, is more debatable:
>
> --- a/src/cmp/cmpmain.lsp
> +++ b/src/cmp/cmpmain.lsp
> @@ -703,7 +703,7 @@ compiled successfully, returns the pathname of the compiled file"
> (setf warning-p t))
> ((typep i '(or compiler-error warning))
> (setf warning-p t failure-p t)))
> - finally (return (values (and (not failure-p) main-value) warning-p failure-p))))
> + finally (return (values (and #+nil (not failure-p) main-value) warning-p failure-p))))
>
> #-dlopen
> (defun compile (name &optional (def nil supplied-p))
>
> Rationale: CLHS does not specify that the first value should be set
> to NIL if failure-p is true, only if the compilation
> actually failed. In this case there were only some
> (warn...)s that remind about unimplemented code.
>
> > The primary value returned by compile-file, output-truename, is the truename of the
> > output file, or nil if the file could not be created.
More information about the ecl-devel
mailing list