-
-
Save riccardomurri/4b64ef9b56132b95574d 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
(de qq Args | |
(if (== Args NIL) | |
# `() -> NIL | |
NIL | |
# else, Args is a single-element list, extract body forms | |
(setq Body (car Args)) | |
(if (not (lst? Body)) | |
# `atom -> atom | |
Body | |
# else Body is a list that we must unpack | |
(let (Head (car Body) | |
Rest (cdr Body) ) | |
(if (== Rest NIL) | |
(cons Head) | |
# else, start constructing a list | |
(if (== Head '!) | |
# unquote! | |
(eval Rest) | |
# pop one item from list and recurse | |
(list Head (eval (cons 'qq Rest))) ) ) ) ) ) ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment