Last active
September 16, 2015 14:02
-
-
Save eshamster/2ce7581438fea277ef4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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