diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-08-14 22:38:26 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-08-14 22:38:26 -0700 |
commit | f283c37f4ead35b39f6cff2cf0156af95a8d4376 (patch) | |
tree | 9353be2b6df9f920d25f73f47c566d4dc86d172a /eval.c | |
parent | 3a905766e6ed9fac09e14a1d618395670062c98d (diff) | |
download | txr-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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)); |