Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@eshamster
Last active September 16, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eshamster/2ce7581438fea277ef4a to your computer and use it in GitHub Desktop.
Save eshamster/2ce7581438fea277ef4a to your computer and use it in GitHub Desktop.
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros +Q -- $0 "$@"
|#
(defun do-nothing (&rest rest)
(declare (ignore rest)))
(defun make-list-reader (stream &rest rest)
(declare (ignore rest))
(let ((*readtable* (copy-readtable *readtable*)))
(set-macro-character #\] #'do-nothing)
(set-macro-character #\[ #'make-list-reader)
(let ((readed (read-delimited-list #\] stream t)))
(print `(readed = ,readed))
`(list ,@readed))))
(eval-when (:execute)
(set-dispatch-macro-character
#\# #\[ #'make-list-reader))
(defun main (&rest argv)
(declare (ignorable argv))
(print #[1 [2 3 #[4 'test 5]] 6])
(format t "~%"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment