summaryrefslogtreecommitdiff
path: root/Lisp
diff options
context:
space:
mode:
Diffstat (limited to 'Lisp')
-rw-r--r--Lisp/defpackage.lisp1
-rw-r--r--Lisp/reader-syntax.lisp15
2 files changed, 12 insertions, 4 deletions
diff --git a/Lisp/defpackage.lisp b/Lisp/defpackage.lisp
index 074e8ab..3c560e5 100644
--- a/Lisp/defpackage.lisp
+++ b/Lisp/defpackage.lisp
@@ -25,6 +25,7 @@
#:shutdown-runtime
#:install-reader-syntax
#:enable-method-syntax
+ #:in-method-syntax
#:enable-objective-c-syntax
#:disable-method-syntax
#:disable-objective-c-syntax
diff --git a/Lisp/reader-syntax.lisp b/Lisp/reader-syntax.lisp
index 18174d2..905807d 100644
--- a/Lisp/reader-syntax.lisp
+++ b/Lisp/reader-syntax.lisp
@@ -22,6 +22,16 @@
(defvar *bracket-syntax-macro-chars* (list))
+(defun in-method-syntax ()
+ ;; FIXME: Document.
+ (setq *readtable* (copy-readtable *readtable*))
+ (push (get-dispatch-macro-character #\# #\/) *method-syntax-macro-chars*)
+ (set-dispatch-macro-character #\# #\/ #'(lambda (stream char arg)
+ (declare (ignore char arg))
+ (read-objective-c-method stream)))
+ (values))
+
+
(defun enable-method-syntax ()
"Install a **reader macro** that makes method calls look nicer.
@@ -76,10 +86,7 @@ __selector__s registered by way of __collect-methods__.
__enable-objective-c-syntax__"
(save-readtable)
- (push (get-dispatch-macro-character #\# #\/) *method-syntax-macro-chars*)
- (set-dispatch-macro-character #\# #\/ #'(lambda (stream char arg)
- (declare (ignore char arg))
- (read-objective-c-method stream)))
+ (in-method-syntax)
(values))