summaryrefslogtreecommitdiff
path: root/Lisp/conditions.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'Lisp/conditions.lisp')
-rw-r--r--Lisp/conditions.lisp29
1 files changed, 20 insertions, 9 deletions
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)))))