23 lines
459 B
Text
23 lines
459 B
Text
(seq
|
|
(def break builtins.flow.break)
|
|
(def continue builtins.flow.continue)
|
|
(def loop builtins.flow.loop)
|
|
|
|
(defmacro return []
|
|
(builtins.flow.return $%% null))
|
|
|
|
(defmacro while [cond] (loop
|
|
(if (eq? $cond :false) (break) :null)
|
|
$%&))
|
|
|
|
(defmacro do-while [cond] (loop
|
|
$%&
|
|
(if (eq? $cond :false) (break) :null)))
|
|
|
|
(defmacro for [var iter] (vec.map
|
|
(lambda [x] (seq
|
|
(def $var x)
|
|
$%&))
|
|
(vec.from $iter)
|
|
))
|
|
)
|