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
commita3028e441150ddac3db3ca9e1851ed547d0f72fc (patch)
tree21ca552d490ee18594391b5d3435abb0c2feedb7 /lib.h
parent99aea60f265cd70597d3c59142500956ed15fec6 (diff)
downloadtxr-a3028e441150ddac3db3ca9e1851ed547d0f72fc.tar.gz
txr-a3028e441150ddac3db3ca9e1851ed547d0f72fc.tar.bz2
txr-a3028e441150ddac3db3ca9e1851ed547d0f72fc.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);