Custom Query (1030 matches)
Results (322 - 324 of 1030)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #1043 | fixed | encode-objc-method-arglist is sensitive to the setting of *print-circle* | ||
| Description |
(encode-objc-method-arglist '(:int :int :int) :int) returns: "#1=i24#1#0#1#8#1#16" (when *print-circle* is bound to non nil). |
|||
| #1084 | fixed | deficient error reporting in flet on bad lambda-list | ||
| Description |
cl-user> (compile-file #P"~/test-flet.lisp")
#P"/home/pjb/test-flet.lx64fsl"
nil
nil
cl-user> (cat #P"~/test-flet.lisp")
(defun f (z)
(flet ((g (x) (list x x))
(u z))
(g z)))
; No value
cl-user>
The fact that the "lambda-list" for u is an atom should signal a program-error. CLHS flet says: lambda-list---a lambda list; for flet and labels, it is an ordinary lambda list; and CLHS 3.4.1 says: The syntax for ordinary lambda lists is as follows:
lambda-list::= (var*
[&optional {var | (var [init-form [supplied-p-parameter]])}*]
[&rest var]
[&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}* [&allow-other-keys]]
[&aux {var | (var [init-form])}*])
so lambda-list for flet and labels cannot be an atom. And in the case where I found this, u was also a global function, so perhaps this could be tested by the compiler to add a hint in the error message that perhaps the form was intented to be in the body of the flet. |
|||
| #1096 | fixed | defsetf ignorable declarations are ignored. | ||
| Description |
It seems the way ignore or ignorable declarations are implemented with defsetf doesn't make them entirely ignored, since a warning is still issued, and indeed, an uninterned symbol used in place of the parameter is still present and not declared anymore as ignored or ignorable. (defgeneric bug (x y &optional z))
(defmethod bug ((x integer) y &optional z)
(declare (ignorable z))
(+ x y))
(defmethod bug ((x string) y &optional z)
(list (aref x y) z))
(defun set-bug (x y new-value)
(+ x y new-value))
(defsetf bug (x y &optional z) (new-value)
(declare (ignorable z))
`(set-bug ,x ,y ,new-value))
(defun f ()
(setf (bug 42 0) 33))
(eval-when (:load-toplevel :execute)
(pprint (swank-backend:macroexpand-all
'(defun f ()
(setf (bug 42 0) 33)))))
#|
dictionary> (load (compile-file #P"~/ccl-bug.lisp"))
;Compiler warnings for "home:ccl-bug.lisp.newest" :
; In f: Unused lexical variable #:z
(progn (ccl::%defun (ccl:nfunction f
lambda
nil
(declare (ccl::global-function-name f))
(block f
(let* ((#:g90598 42) (#:g90597 0))
(declare (ignorable #:g90598 #:g90597))
(multiple-value-call
(lambda (&optional #:g90596 &rest #:ignore)
(declare (ignore #:ignore))
((lambda (#:x #:y &optional #:z) (set-bug #:x #:y #:g90596))
#:g90598 #:g90597))
33))))
'nil)
'f)#P"/home/pjb/ccl-bug.lx64fsl"
|#
|
|||
