diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-06-06 21:15:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-06-06 21:15:34 -0700 |
commit | e1e8eedfd994463db4a3db048117c4bcd9aaf416 (patch) | |
tree | 838621b66f0cc70240bacee753f931b7f594724b | |
parent | 4ab49152980d3b9626d294af7d8ee9c296c09943 (diff) | |
download | txr-e1e8eedfd994463db4a3db048117c4bcd9aaf416.tar.gz txr-e1e8eedfd994463db4a3db048117c4bcd9aaf416.tar.bz2 txr-e1e8eedfd994463db4a3db048117c4bcd9aaf416.zip |
Handle sequence structs in length.
* lib.c (length): In COBJ case, handle
structures which have a car slot.
-rw-r--r-- | lib.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -8048,6 +8048,8 @@ val length(val seq) case COBJ: if (seq->co.cls == hash_s) return hash_count(seq); + if (structp(seq) && maybe_slot(seq, car_s)) + return length_list(nullify(seq)); /* fallthrough */ default: type_mismatch(lit("length: ~s is not a sequence"), seq, nao); |