1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-24 06:03:17 +00:00

Fix loop :iterate.

This commit is contained in:
Calvin Rose 2019-04-28 00:34:32 -04:00
parent 0bad523913
commit 25a93ac4a6
2 changed files with 4 additions and 1 deletions

View File

@ -305,6 +305,7 @@
~(do
(var ,i nil)
(while (set ,i ,expr)
(def ,binding ,i)
,body))))
(defn- loop1
@ -713,7 +714,7 @@
(defn juxt*
"Returns the juxtaposition of functions. In other words,
((juxt* a b c) x) evaluates to ((a x) (b x) (c x))."
((juxt* a b c) x) evaluates to [(a x) (b x) (c x)]."
[& funs]
(fn [& args]
(def ret @[])

View File

@ -45,6 +45,8 @@ int system_test() {
assert(janet_equals(janet_wrap_number(1.4), janet_wrap_number(1.4)));
assert(janet_equals(janet_wrap_number(3.14159265), janet_wrap_number(3.14159265)));
assert(NULL != &janet_wrap_nil);
assert(janet_equals(janet_cstringv("a string."), janet_cstringv("a string.")));
assert(janet_equals(janet_csymbolv("sym"), janet_csymbolv("sym")));