From dcd3ef3f78ee3f17d7c706ccaa1ff74c5dc7f104 Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <kaz@kylheku.com>
Date: Tue, 25 Oct 2016 06:39:58 -0700
Subject: 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.
---
 lib.h | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'lib.h')

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);
-- 
cgit v1.2.3