diff --git a/projects/kiss-spaced-rep/src/kiss_spaced_rep/KSR.kiss b/projects/kiss-spaced-rep/src/kiss_spaced_rep/KSR.kiss index 19e8f3dd..1ac256b2 100644 --- a/projects/kiss-spaced-rep/src/kiss_spaced_rep/KSR.kiss +++ b/projects/kiss-spaced-rep/src/kiss_spaced_rep/KSR.kiss @@ -153,4 +153,15 @@ (let [nextIndex (Std.random studyList.length) nextToStudy (nth studyList nextIndex)] (studyList.splice nextIndex 1) - (nextToStudy engine (studyAll.bind engine))))) \ No newline at end of file + (nextToStudy engine (studyAll.bind engine))))) + +(defReaderMacro ["*" "?"] [stream &builder b] + (let [elements []] + (loop + (let [line (expect stream "An element for a cloze sequence" takeLine)] + (case (line.charAt 0) + ("*" (elements.push (b.str (line.substr 1)))) + ("?" (elements.push (b.str line))) + ("" (break)) + (otherwise (throw "bad element for a cloze sequence: $line"))))) + `(cloze ,@elements))) \ No newline at end of file