KSR reader macros for basic and reversed cards
This commit is contained in:
@@ -164,4 +164,16 @@
|
||||
("?" (elements.push (b.str line)))
|
||||
("" (break))
|
||||
(otherwise (throw "bad element for a cloze sequence: $line")))))
|
||||
`(cloze ,@elements)))
|
||||
`(cloze ,@elements)))
|
||||
|
||||
(defMacroFunction btDefault [exp]
|
||||
(case (Type.enumConstructor exp.def)
|
||||
("StrExp"
|
||||
`(basicText ,exp))
|
||||
(otherwise exp)))
|
||||
|
||||
(defReaderMacro "=>" [stream]
|
||||
`(card ,(btDefault (read stream)) ,(btDefault (read stream))))
|
||||
|
||||
(defReaderMacro "<=>" [stream]
|
||||
`(reversed ,(btDefault (read stream)) ,(btDefault (read stream))))
|
||||
|
Reference in New Issue
Block a user