From: SourceForge.net <no...@so...> - 2011-08-03 14:23:10
|
Bugs item #3384693, was opened at 2011-08-02 10:19 Message generated for change (Comment added) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3384693&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: lisp error >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Sam Steingold (sds) Assigned to: Sam Steingold (sds) Summary: no warning on bad :report function in define-condition Initial Comment: (define-condition simple-foo (simple-error) () (:report (lambda (condition) (let ((fstring (simple-condition-format-control condition))) (if fstring (apply #'format stream fstring (simple-condition-format-arguments condition)) (clos:call-next-method)))))) the :report lambda is bad: it takes one argument instead of two. however, no warning is issued because define-condition macroexpands to (PROGN (DEFCLASS SIMPLE-FOO (SIMPLE-ERROR) NIL) (DEFMETHOD PRINT-OBJECT ((CONDITION SIMPLE-FOO) STREAM) (IF (OR *PRINT-ESCAPE* *PRINT-READABLY*) (CALL-NEXT-METHOD) (PROGN (FUNCALL #'(LAMBDA (CONDITION) (LET ((FSTRING (SIMPLE-CONDITION-FORMAT-CONTROL CONDITION))) (IF FSTRING (APPLY #'FORMAT STREAM FSTRING (SIMPLE-CONDITION-FORMAT-ARGUMENTS CONDITION)) (CALL-NEXT-METHOD)))) CONDITION STREAM) CONDITION))) 'SIMPLE-FOO) and the lambda lives inside a print-object method where STEAM is already bound. (if STREAM is replaced by ZZZ inside the body of lambda, there _is_ a warning!) ergo: funcall should issue a warning here. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2011-08-03 10:23 Message: thank you for your bug report. the bug has been fixed in the source tree (mercurial/hg). you can either wait for the next release (recommended) or check out the current mercurial tree (see http://clisp.org) and build CLISP from the sources (be advised that between releases the source tree is very unstable and may not even build on your platform). ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2011-08-02 19:20 Message: also should warn: (mapcar (lambda () 1) '(1 2 3)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3384693&group_id=1355 |