diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-06-25 02:25:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-06-25 02:25:11 -0700 |
commit | 87945557de850fbea3a6b9541f47f6c71eb6c114 (patch) | |
tree | 5304193226e5e41fdfe84f2b1a6016d206c0963f | |
parent | 9ee9fbf02e7de23bddc20013e3087b16dfa7672a (diff) | |
download | txr-87945557de850fbea3a6b9541f47f6c71eb6c114.tar.gz txr-87945557de850fbea3a6b9541f47f6c71eb6c114.tar.bz2 txr-87945557de850fbea3a6b9541f47f6c71eb6c114.zip |
nullify: handle carray and hashes.
* lib.c (nullify): Add carray and hash subcases into
the COBJ case.
-rw-r--r-- | lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |