4 ms·
Do it yourself! (Implementation loosely based on phantomics' comment below.) (defun april-reader (stream char) (declare (ignore char)) `(april
by phoe-krk 6y ago
Do it yourself! (Implementation loosely based on phantomics' comment below.)
(defun april-reader (stream char)
(declare (ignore char))
`(april ,(read stream t nil t)))
(set-macro-character #\⎕ #'april-reader)
- Avshalom 6y agoYou're probably gonna want something more complicated than that. Glancing at the github page it looks like at least the following need to be dealt with: (april "apl code") ; and april-f (april (with (stuff)) "apl code") ; and april-f (april-c "apl code" (input)) (april-c (with (stuff)) "apl code" (input))
- phoe-krk 6y agoYes, the above is a trivial implementation; handling multi-form input would need to be much more complex. Thankfully, for simple one-liners, you'll likely want either April literals (implemented above) or April anonymous functions, both of which won't take additional arguments; you should be able to implement both as simple reader macros.