:test #'char= :key #'car)))
(set-cat-entry to-char att to-readtable)
(set-cmt-entry to-char mac to-readtable)
- (when from-dpair
- (cond
- (to-dpair
- (let ((table (cdr to-dpair)))
- (clrhash table)
- (shallow-replace/eql-hash-table table (cdr from-dpair))))
- (t
- (let ((pair (cons to-char (make-hash-table))))
- (shallow-replace/eql-hash-table (cdr pair) (cdr from-dpair))
+ (cond ((and (not from-dpair) (not to-dpair)))
+ ((and (not from-dpair) to-dpair)
(setf (dispatch-tables to-readtable)
- (push pair (dispatch-tables to-readtable)))))))))
+ (remove to-dpair (dispatch-tables to-readtable))))
+ (to-dpair
+ (let ((table (cdr to-dpair)))
+ (clrhash table)
+ (shallow-replace/eql-hash-table table (cdr from-dpair))))
+ (t
+ (let ((pair (cons to-char (make-hash-table))))
+ (shallow-replace/eql-hash-table (cdr pair) (cdr from-dpair))
+ (setf (dispatch-tables to-readtable)
+ (push pair (dispatch-tables to-readtable))))))))
t)
(defun set-macro-character (char function &optional
(read-from-string "`#2A((,(1+ 0) 0) (0 0))")
(reader-error ()
:error)))))
+
+(with-test (:name set-syntax-from-char-dispatch-macro-char)
+ (let ((rt (copy-readtable)))
+ (make-dispatch-macro-character #\! nil rt)
+ (set-dispatch-macro-character #\! #\! (constantly 'bang^2) rt)
+ (flet ((maybe-bang ()
+ (let ((*readtable* rt))
+ (read-from-string "!!"))))
+ (assert (eq 'bang^2 (maybe-bang)))
+ (set-syntax-from-char #\! #\! rt)
+ (assert (eq '!! (maybe-bang))))))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.48.12"
+"1.0.48.13"