RosettaCodeData/Task/S-expressions/Common-Lisp/s-expressions-1.lisp
2023-07-01 13:44:08 -04:00

5 lines
330 B
Common Lisp

(defun lsquare-reader (stream char)
(declare (ignore char))
(read-delimited-list #\] stream t))
(set-macro-character #\[ #'lsquare-reader) ;;Call the lsquare-reader function when a '[' token is parsed
(set-macro-character #\] (get-macro-character #\) nil)) ;;Do the same thing as ')' when a ']' token is parsed