Skip to content

Possibly missing reader macros #6

@phoe

Description

@phoe

(defmethod print-object ((vec vector-trie) stream)
(declare (type stream stream))
(when (transient-vector-p vec)
(write-char #\#)
(write-char #\T))
(let ((len (vec-count vec)))
(declare (type fixnum len))
(if (> len *max-print-vec-length*)
(progn
(format stream "#S(~A|length:~a)" (type-of vec) len))
(progn (write-char #\[ stream)
(loop with itr = (vec-make-iterator vec)
for (remaining val) = (multiple-value-list (funcall itr))
then (list next-remaining next-val)
while remaining
for (next-remaining next-val) = (multiple-value-list (funcall itr))
do (prin1 val stream)
(when next-remaining (write-char #\ stream)))
(write-char #\] stream)))))

Where are the reader macros for #T and [ defined, in order to read these objects back into Lisp? I cannot see them anywhere. It would be good to depend on named-readtables and define a custom readtable including these macro characters for easy readtable composition, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions