Skip to content

Instantly share code, notes, and snippets.

@riccardomurri
Created March 27, 2015 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardomurri/4b64ef9b56132b95574d to your computer and use it in GitHub Desktop.
Save riccardomurri/4b64ef9b56132b95574d to your computer and use it in GitHub Desktop.
(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