1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-29 09:50:27 +00:00

Def and var evaluate to useful values.

This commit is contained in:
Calvin Rose 2018-09-21 14:09:38 -04:00
parent 7b9aedc53b
commit 16ac7ba1a1

View File

@ -195,9 +195,8 @@ static JanetSlot janetc_var(JanetFopts opts, int32_t argn, const Janet *argv) {
JanetSlot ret = dohead(c, opts, &head, argn, argv);
if (c->result.status == JANET_COMPILE_ERROR)
return janetc_cslot(janet_wrap_nil());
if (destructure(c, argv[0], ret, varleaf, handleattr(c, argn, argv)))
janetc_freeslot(c, ret);
return janetc_cslot(janet_wrap_nil());
destructure(c, argv[0], ret, varleaf, handleattr(c, argn, argv));
return ret;
}
static int defleaf(
@ -229,9 +228,8 @@ static JanetSlot janetc_def(JanetFopts opts, int32_t argn, const Janet *argv) {
JanetSlot ret = dohead(c, opts, &head, argn, argv);
if (c->result.status == JANET_COMPILE_ERROR)
return janetc_cslot(janet_wrap_nil());
if (destructure(c, argv[0], ret, defleaf, handleattr(c, argn, argv)))
janetc_freeslot(c, ret);
return janetc_cslot(janet_wrap_nil());
destructure(c, argv[0], ret, defleaf, handleattr(c, argn, argv));
return ret;
}
/*