Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 01778ed60e
Fetching contributors…

Cannot retrieve contributors at this time

111 lines (87 sloc) 1.91 kb
mac do1 body
`(ret $ret ,car.body
mac between(before after/and . body)
(do ,before ,@body)
mac before(cleanup . body)
(do ,@body)
mac when(cond . body)
`(if ,cond
(do ,@body))
mac unless(cond . body)
`(if !,cond
(do ,@body))
mac iflet(var expr . branches)
if !branches
`(let $tmp ,expr
(if $tmp
(let ,var $tmp
,(if cdr.branches
`(iflet ,var ,@cdr.branches))))
mac aif(expr . branches)
`(iflet it ,expr ,@branches)
mac whenlet(var test . body)
`(iflet ,var ,test
(do ,@body))
mac awhen(test . body)
`(whenlet it ,test
mac aand args
`(aif ,car.args
(aand ,@cdr.args)))
mac while(test . body)
`(when ,test
(while ,test
mac whilet(var test . body)
`(let ,var nil
(while (= ,var ,test)
mac awhile(test . body)
`(whilet it ,test
mac for(var start test update . body)
`(let ,var ,start
(while ,test
mac each(var expr . body)
`(for $i (as list ,expr) $i (zap cdr $i)
(let ,var car.$i
mac on(var expr . body)
`(for ($i index) (list ,expr 0) $i (do (zap cdr $i) ++.index)
(let ,var car.$i
mac forlen(var expr . body)
`(for ,var 0 (< ,var len.,expr) ++.,var
mac repeat(n . body)
`(for $i 0 (< $i ,n) ++.$i
mac repeat(n . body) :case (iso :forever n)
`(while 1 ,@body)
def andf fs
(fn args
(let sub (afn(fs)
(car.fs @args)
(and (car.fs @args) (self cdr.fs))))
(sub fs)))
Jump to Line
Something went wrong with that request. Please try again.