Commit 20f599b9 authored by Stephen Compall's avatar Stephen Compall

port to Clozure CL

darcs-hash:20080925033525-61e6f-0fabebb2c5df4fb6e11993da5379e04d8966bcda.gz
parent 038f1f3b
......@@ -30,16 +30,18 @@
(declaim (inline %standard-readtable))
(defun %standard-readtable ()
#-sbcl (copy-readtable nil)
#-sbcl+sb-reader (copy-readtable nil)
#+sbcl+sb-reader sb-reader:*standard-readtable*)
#+sbcl+sb-reader sb-reader:*standard-readtable*
#+clozure ccl::%initial-readtable%
#-(or sbcl+sb-reader clozure)
(copy-readtable nil))
#+sbcl+sb-reader
(defmacro %with-readtable-iterator ((name readtable) &body body)
`(sb-reader:with-readtable-iterator (,name ,readtable) ,@body))
#-sbcl+sb-reader
#+(or (and sbcl (not sbcl+sb-reader)) clozure)
(progn
#+sbcl
(defun make-readtable-iterator (readtable)
(let ((char-macro-array (sb-impl::character-macro-array readtable))
(char-macro-ht (sb-impl::character-macro-hash-table readtable))
......@@ -72,6 +74,17 @@
(values t disp-ch disp-fn t sub-char-alist)))))
#'grovel1))))
#+clozure
(defun make-readtable-iterator (readtable)
(let ((char-macro-alist (ccl::rdtab.alist readtable)))
(lambda ()
(if char-macro-alist
(destructuring-bind (char . defn) (pop char-macro-alist)
(if (consp defn)
(values t char (car defn) t (cdr defn))
(values t char defn nil nil)))
(values nil nil nil nil nil)))))
(defmacro %with-readtable-iterator ((name readtable) &body body)
(let ((it (gensym)))
`(let ((,it (make-readtable-iterator ,readtable)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment