From 417ac76fc4b289f5135680ee7300fee2dd31f1e6 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Mon, 24 Sep 2007 17:00:30 +0200 Subject: Fix condition signalling. darcs-hash:d14fd897e9b232e09261823625f1083b6d37aa11 --- Lisp/conditions.lisp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'Lisp/conditions.lisp') diff --git a/Lisp/conditions.lisp b/Lisp/conditions.lisp index 839838e..86897ba 100644 --- a/Lisp/conditions.lisp +++ b/Lisp/conditions.lisp @@ -1,14 +1,26 @@ (in-package #:mulk.objective-cl) +(define-condition simple-style-warning (style-warning) + ((format-control :initarg :format-control + :reader format-control) + (format-arguments :initarg :format-arguments + :reader format-arguments)) + (:report (lambda (condition stream) + (apply #'format + stream + (format-control condition) + (format-arguments condition))))) + + (define-condition no-such-selector (error) ((designator :initarg :designator :reader rejected-selector-designator)) (:report (lambda (condition stream) - (with-slots (designator) condition - (format stream - "~S does not designate a known selector." - designator))))) + ;; The CLHS forbids the use of WITH-SLOTS for conditions. + (format stream + "~S does not designate a known selector." + (rejected-selector-designator condition))))) (define-condition message-not-understood (error) @@ -17,9 +29,8 @@ (class :initarg :class :reader rejecting-class)) (:report (lambda (condition stream) - (with-slots (selector class) condition - (format stream - "The Objective-C class ~S does not understand the ~ + (format stream + "The Objective-C class ~S does not understand the ~ message ~S." - class - selector))))) + (rejecting-class condition) + (rejected-selector condition))))) -- cgit v1.2.3