diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-25 06:39:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-25 06:39:58 -0700 |
commit | dcd3ef3f78ee3f17d7c706ccaa1ff74c5dc7f104 (patch) | |
tree | 21ca552d490ee18594391b5d3435abb0c2feedb7 /eval.c | |
parent | 95abf5aa1cb792bdcb472399d1ef9dfc9b9088e0 (diff) | |
download | txr-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 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -4977,7 +4977,9 @@ void eval_init(void) reg_fun(intern(lit("ldiff"), user_package), func_n2(ldiff)); reg_fun(intern(lit("last"), user_package), func_n1(last)); reg_fun(intern(lit("butlast"), user_package), func_n1(butlast)); + reg_fun(intern(lit("nthlast"), user_package), func_n2(nthlast)); reg_fun(intern(lit("nthcdr"), user_package), func_n2(nthcdr)); + reg_fun(intern(lit("butlastn"), user_package), func_n2(butlastn)); reg_fun(intern(lit("flatten"), user_package), func_n1(flatten)); reg_fun(intern(lit("flatten*"), user_package), func_n1(lazy_flatten)); reg_fun(intern(lit("flatcar"), user_package), func_n1(flatcar)); |