Commit fc1f6cec authored by asmyles's avatar asmyles

more uri syntax stuff

parent b9017d1c
......@@ -31,3 +31,21 @@
(uri (read stream t nil t))))
(set-dispatch-macro-character (char uri-dmc 0) (char uri-dmc 1) readtable)))
(defmacro with-uri-syntax ((uri-dmc) &body body)
`(let ((*readtable* (copy-readtable))
(*print-pprint-dispatch* (copy-pprint-dispatch)))
(set-uri-reader-syntax ,uri-dmc)
(set-uri-printer-syntax ,uri-dmc)
(defmacro using-topicmap-syntax (uri-dmc)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(topicmap:set-uri-reader-syntax ,uri-dmc)))
;this temporarily overides print-object from uri
(defun set-uri-printer-syntax (uri-dmc &optional (table *print-pprint-dispatch*))
(flet ((uri (stream uri)
(if *print-escape*
(format stream "~A~A" uri-dmc uri)
(print-object stream uri))))
(set-pprint-dispatch 'uri (function uri) 1 table)))
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