release 0.1.0
This commit is contained in:
commit
30d94536a9
90 changed files with 7722 additions and 0 deletions
23
modules/core/loop.owa
Normal file
23
modules/core/loop.owa
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(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)
|
||||
))
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue