diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-04 06:16:32 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-04 06:16:32 -0700 |
commit | 755f99d4f397cc2357468e3c2dc19d3ea451dedb (patch) | |
tree | 02358f6b761edff37462d732a97bea7033195842 /lib.c | |
parent | 20758a37854c852c5a6574ced48bb0aca9417132 (diff) | |
download | txr-755f99d4f397cc2357468e3c2dc19d3ea451dedb.tar.gz txr-755f99d4f397cc2357468e3c2dc19d3ea451dedb.tar.bz2 txr-755f99d4f397cc2357468e3c2dc19d3ea451dedb.zip |
length and empty functions support ranges.
* lib.c (length, empty): Handle RNG in switch.
* txr.1: Documented.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |