summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 29d11ef9..89782b25 100644
--- a/lib.c
+++ b/lib.c
@@ -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);