summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-25 02:25:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-25 02:25:11 -0700
commit8d84ffa58f835367ceab1d77d07ff3a72f09378d (patch)
tree5304193226e5e41fdfe84f2b1a6016d206c0963f /lib.c
parent9bab9ac8f5634964fe106caace56315b33c06f36 (diff)
downloadtxr-8d84ffa58f835367ceab1d77d07ff3a72f09378d.tar.gz
txr-8d84ffa58f835367ceab1d77d07ff3a72f09378d.tar.bz2
txr-8d84ffa58f835367ceab1d77d07ff3a72f09378d.zip
nullify: handle carray and hashes.
* lib.c (nullify): Add carray and hash subcases into the COBJ case.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 7614aab2..7d47a042 100644
--- a/lib.c
+++ b/lib.c
@@ -1011,6 +1011,10 @@ val nullify(val seq)
case BUF:
return if3(length_buf(seq) != zero, seq, nil);
case COBJ:
+ if (seq->co.cls == carray_s)
+ return if3(length_carray(seq) != zero, seq, nil);
+ if (seq->co.cls == hash_s)
+ return if3(hash_count(seq) != zero, seq, nil);
if (obj_struct_p(seq)) {
val nullify_meth = maybe_slot(seq, nullify_s);
if (nullify_meth)