summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 1e127e88..cf137699 100644
--- a/lib.c
+++ b/lib.c
@@ -1440,6 +1440,28 @@ val iter_reset(val iter, val obj)
}
}
+val iterp(val obj)
+{
+ switch (type(obj)) {
+ case NIL:
+ case CHR:
+ case NUM:
+ case BGNUM:
+ case FLNUM:
+ case CONS:
+ case LCONS:
+ return t;
+ case COBJ:
+ if (obj->co.cls == seq_iter_cls)
+ return t;
+ if (obj_struct_p(obj) && get_special_slot(obj, iter_step_m))
+ return t;
+ /* fallthrough */
+ default:
+ return nil;
+ }
+}
+
val iter_catv(varg iters)
{
cnum index = 0;