1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

[] should evaluate to ()

This is consistent with most bracket tuples.
This commit is contained in:
Calvin Rose 2019-10-20 14:06:28 -05:00
parent 99ef4c7510
commit 9097e36ea0

View File

@ -628,7 +628,7 @@ JanetSlot janetc_value(JanetFopts opts, Janet x) {
const Janet *tup = janet_unwrap_tuple(x);
/* Empty tuple is tuple literal */
if (janet_tuple_length(tup) == 0) {
ret = janetc_cslot(x);
ret = janetc_cslot(janet_wrap_tuple(janet_tuple_n(NULL, 0)));
} else if (janet_tuple_flag(tup) & JANET_TUPLE_FLAG_BRACKETCTOR) { /* [] tuples are not function call */
ret = janetc_tuple(opts, x);
} else {