From 2deb1846c43a3deea56be09d90705504aaa29184 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 11 Jun 2017 08:15:16 -0700 Subject: length function supports carray. * lib.c (length): Handle COBJ of carray type. * txr.1: Documented. --- lib.c | 2 ++ txr.1 | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/lib.c b/lib.c index 4cb28c73..56cbf4ae 100644 --- a/lib.c +++ b/lib.c @@ -9131,6 +9131,8 @@ val length(val seq) case COBJ: if (seq->co.cls == hash_s) return hash_count(seq); + if (seq->co.cls == carray_s) + return length_carray(seq); if (structp(seq) && maybe_slot(seq, car_s)) return length_proper_list(nullify(seq)); /* fallthrough */ diff --git a/txr.1 b/txr.1 index bd5de7e3..122c60e3 100644 --- a/txr.1 +++ b/txr.1 @@ -24798,6 +24798,12 @@ is -11 and of The buffer length calculated by .code length-buf is returned. +.coIP carray +The number of elements in +.meta object +calculated by +.code length-carray +is returned. .RE .IP -- cgit v1.2.3