summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-25 06:39:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-25 06:39:58 -0700
commitdcd3ef3f78ee3f17d7c706ccaa1ff74c5dc7f104 (patch)
tree21ca552d490ee18594391b5d3435abb0c2feedb7 /lib.h
parent95abf5aa1cb792bdcb472399d1ef9dfc9b9088e0 (diff)
downloadtxr-dcd3ef3f78ee3f17d7c706ccaa1ff74c5dc7f104.tar.gz
txr-dcd3ef3f78ee3f17d7c706ccaa1ff74c5dc7f104.tar.bz2
txr-dcd3ef3f78ee3f17d7c706ccaa1ff74c5dc7f104.zip
New accessors nthlast and butlastn.
* eval.c (eval_init): register nthlast and butlastn intrinsicis. * lib.c (nthlast, butlastn): New function. * lib.h (nthlast, butlastn): Declared. * share/txr/stdlib/place.tl (defplace nthlast, defplace butlastn): New places. * txr.1: Documented nthlast and butlastn.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 872747af..5092d73d 100644
--- a/lib.h
+++ b/lib.h
@@ -508,7 +508,9 @@ loc tail(val cons);
loc term(loc head);
loc lastcons(val list);
val last(val list);
+val nthlast(val pos, val list);
val nthcdr(val pos, val list);
+val butlastn(val n, val list);
loc ltail(loc cons);
val pop(val *plist);
val upop(val *plist, val *pundo);