Wave 4: add sequences/vectors/files chapters, 23 exercises, quiz3, finish ceremony, PCL table
This commit is contained in:
1 parent
77843402fa
commit
4675bd1106
76 files changed
+2505
-14
No files matched your search
@@ -0,0 +1,15 @@
|
||||
;;; MACROS 5: READER MACROS, A TASTER (solution)
|
||||
|
||||
(defun maybe-reader (stream sub-char num-arg)
|
||||
(declare (ignore sub-char num-arg))
|
||||
(list 'maybe (read stream)))
|
||||
|
||||
(set-dispatch-macro-character #\# #\? #'maybe-reader)
|
||||
|
||||
;;; ------------------------------------------------------------------
|
||||
;;; Checks. Read them - they tell you what to aim for - but leave
|
||||
;;; them unchanged.
|
||||
;;; ------------------------------------------------------------------
|
||||
|
||||
(check-equal '(maybe red) '#?red)
|
||||
(check-equal '(maybe (1 2)) '#?(1 2))
|
||||
Reference in new issue
Block a user