aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-20 15:46:52 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-21 13:19:47 +0200
commitfedde03f1e6b47784bd2b7d55247e5f2e08a6385 (patch)
tree985c94ec694567aa7bad9d175808d18151122bb8
parent23da3966147a99ce80c52b80022f6b159ba7ded6 (diff)
downloadell-fedde03f1e6b47784bd2b7d55247e5f2e08a6385.tar.gz
ell-fedde03f1e6b47784bd2b7d55247e5f2e08a6385.tar.xz
ell-fedde03f1e6b47784bd2b7d55247e5f2e08a6385.zip
Decided: () is our nil/undef
-rwxr-xr-xell.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ell.c b/ell.c
index e277d3f..c73ba9e 100755
--- a/ell.c
+++ b/ell.c
@@ -908,8 +908,10 @@ defn (fn_set) {
if ((value = name->next))
return set (ctx, name->value, value);
- // FIXME: how do we represent a nil value here?
- return check (ctx, (*result = new_clone (get (ctx, name->value))));
+ // We return an empty list for a nil value
+ if (!(value = get (ctx, name->value)))
+ return check (ctx, (*result = new_list (NULL)));
+ return check (ctx, (*result = new_clone (value)));
}
defn (fn_list) {