From 7f7379793f4732b09350798c22d9ed22dd2f11ba Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 5 Oct 2015 06:20:08 -0700 Subject: New functions take, drop, {take,drop}-{while,until}. * lib.c (take_list_fun, take_while_list_fun, take_until_list_fun): New static functions. (take, take_while, take_until, drop, drop_while, drop_until): New functions. * eval.c (eval_init): Register intrinsics take, take-while, take-until, drop, drop-while, drop-until. * txr.1: Documented. --- lib.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib.h') diff --git a/lib.h b/lib.h index 41b8608b..e48904a4 100644 --- a/lib.h +++ b/lib.h @@ -872,6 +872,12 @@ val pos(val list, val key, val testfun, val keyfun); val pos_if(val pred, val list, val key); val pos_max(val seq, val testfun, val keyfun); val pos_min(val seq, val testfun, val keyfun); +val take(val count, val seq); +val take_while(val pred, val seq, val keyfun); +val take_until(val pred, val seq, val keyfun); +val drop(val count, val seq); +val drop_while(val pred, val seq, val keyfun); +val drop_until(val pred, val seq, val keyfun); val in(val seq, val key, val testfun, val keyfun); val set_diff(val list1, val list2, val testfun, val keyfun); val copy(val seq); -- cgit v1.2.3