1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +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); JanetSlot ret = dohead(c, opts, &head, argn, argv);
if (c->result.status == JANET_COMPILE_ERROR) if (c->result.status == JANET_COMPILE_ERROR)
return janetc_cslot(janet_wrap_nil()); return janetc_cslot(janet_wrap_nil());
if (destructure(c, argv[0], ret, varleaf, handleattr(c, argn, argv))) destructure(c, argv[0], ret, varleaf, handleattr(c, argn, argv));
janetc_freeslot(c, ret); return ret;
return janetc_cslot(janet_wrap_nil());
} }
static int defleaf( 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); JanetSlot ret = dohead(c, opts, &head, argn, argv);
if (c->result.status == JANET_COMPILE_ERROR) if (c->result.status == JANET_COMPILE_ERROR)
return janetc_cslot(janet_wrap_nil()); return janetc_cslot(janet_wrap_nil());
if (destructure(c, argv[0], ret, defleaf, handleattr(c, argn, argv))) destructure(c, argv[0], ret, defleaf, handleattr(c, argn, argv));
janetc_freeslot(c, ret); return ret;
return janetc_cslot(janet_wrap_nil());
} }
/* /*