From: SourceForge.net <no...@so...> - 2011-08-02 14:20:32
|
Bugs item #3384693, was opened at 2011-08-02 10:19 Message generated for change (Settings changed) 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: Open Resolution: None 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3384693&group_id=1355 |