From 755f99d4f397cc2357468e3c2dc19d3ea451dedb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 4 Oct 2016 06:16:32 -0700 Subject: length and empty functions support ranges. * lib.c (length, empty): Handle RNG in switch. * txr.1: Documented. --- lib.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 062f35c6..8676f9e2 100644 --- a/lib.c +++ b/lib.c @@ -8150,6 +8150,8 @@ val length(val seq) return length_str(seq); case VEC: return length_vec(seq); + case RNG: + return minus(to(seq), from(seq)); case COBJ: if (seq->co.cls == hash_s) return hash_count(seq); @@ -8176,6 +8178,8 @@ val empty(val seq) return length_str_le(seq, zero); case VEC: return eq(length_vec(seq), zero); + case RNG: + return eql(from(seq), to(seq)); case COBJ: if (seq->co.cls == hash_s) return eq(hash_count(seq), zero); -- cgit v1.2.3