Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (22 sloc) 723 Bytes
; given params, return code to construct the args
; (mac arg1 arg2 . body) => `(,mac ,arg1 ,arg2 ,@body)
def construct-macro-call(args)
if list?.args
`(cons ,car.args ,(construct-macro-call cdr.args))
args
let $mac mac
mac! mac(name params . body)
if (~iso :case car.body)
`(,$mac ,name ,params ,@body)
`(let $super ,name
(mac! ,name ,params
if ,cadr.body
(do ,@cddr.body)
,(construct-macro-call (cons '$super params)))) ; call super with params
mac def(name params . body) :case (iso :case car.body)
`(let $old ,name
(def! ,name $params
let ,params $params
if ,cadr.body
(do ,@body)
($old @$params)))
Something went wrong with that request. Please try again.