summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-08-14 22:38:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-08-14 22:38:26 -0700
commitf283c37f4ead35b39f6cff2cf0156af95a8d4376 (patch)
tree9353be2b6df9f920d25f73f47c566d4dc86d172a /eval.c
parent3a905766e6ed9fac09e14a1d618395670062c98d (diff)
downloadtxr-f283c37f4ead35b39f6cff2cf0156af95a8d4376.tar.gz
txr-f283c37f4ead35b39f6cff2cf0156af95a8d4376.tar.bz2
txr-f283c37f4ead35b39f6cff2cf0156af95a8d4376.zip
mapcar: introduce map as a synonym.
* eval.c (eval_init): Bind new map symbol to the same function as mapcar. * txr.1: Documented.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index c1bb2c51..422f903f 100644
--- a/eval.c
+++ b/eval.c
@@ -7354,7 +7354,12 @@ void eval_init(void)
reg_fun(intern(lit("length-list"), user_package), func_n1(length_list));
reg_fun(intern(lit("length-list-<"), user_package), func_n2(length_list_lt));
- reg_fun(intern(lit("mapcar"), user_package), func_n1v(mapcarv));
+ {
+ val mapcar_f = func_n1v(mapcarv);
+ reg_fun(intern(lit("mapcar"), user_package), mapcar_f);
+ reg_fun(intern(lit("map"), user_package), mapcar_f);
+ }
+
reg_fun(intern(lit("mapcar*"), user_package), func_n1v(lazy_mapcarv));
reg_fun(intern(lit("mappend"), user_package), func_n1v(mappendv));
reg_fun(intern(lit("mappend*"), user_package), func_n1v(lazy_mappendv));