1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 00:10:27 +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 ~(do
(var ,i nil) (var ,i nil)
(while (set ,i ,expr) (while (set ,i ,expr)
(def ,binding ,i)
,body)))) ,body))))
(defn- loop1 (defn- loop1
@ -713,7 +714,7 @@
(defn juxt* (defn juxt*
"Returns the juxtaposition of functions. In other words, "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] [& funs]
(fn [& args] (fn [& args]
(def ret @[]) (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(1.4), janet_wrap_number(1.4)));
assert(janet_equals(janet_wrap_number(3.14159265), janet_wrap_number(3.14159265))); 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_cstringv("a string."), janet_cstringv("a string.")));
assert(janet_equals(janet_csymbolv("sym"), janet_csymbolv("sym"))); assert(janet_equals(janet_csymbolv("sym"), janet_csymbolv("sym")));