Skip to content

Instantly share code, notes, and snippets.

@hyotang666
Created July 25, 2020 11:14
Show Gist options
  • Save hyotang666/99db5d7f64b86e98ce68059a52021694 to your computer and use it in GitHub Desktop.
Save hyotang666/99db5d7f64b86e98ce68059a52021694 to your computer and use it in GitHub Desktop.
(defun |#(-reader| (stream character number)
(declare (ignore character number))
`(load-time-value (numcl:asarray ',(read-delimited-list #\) stream t))))
(defun |#A-reader| (stream character number)
(declare (ignore character))
`(load-time-value (let ((array (numcl:asarray ',(read stream t t t))))
(assert (= (array-rank array) ,number))
array)))
(named-readtables:defreadtable numcl::numcl-reader
(:merge :standard)
(:dispatch-macro-char #\# #\( '|#(-reader|)
(:dispatch-macro-char #\# #\A '|#A-reader|))
(named-readtables:in-readtable numcl::numcl-reader)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment