mirror of
https://github.com/janet-lang/janet
synced 2024-12-25 07:50:27 +00:00
Fix loop :iterate.
This commit is contained in:
parent
0bad523913
commit
25a93ac4a6
@ -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 @[])
|
||||||
|
@ -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")));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user