diff options
-rw-r--r-- | eval.c | 7 | ||||
-rw-r--r-- | txr.1 | 9 |
2 files changed, 14 insertions, 2 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)); @@ -38119,9 +38119,10 @@ and .code hash-diff should be used instead. -.coNP Functions @, mapcar @, mappend @ mapcar* and @ mappend* +.coNP Functions @, mapcar @, map @, mappend @ mapcar* and @ mappend* .synb .mets (mapcar < function << iterable *) +.mets (map < function << iterable *) .mets (mappend < function << iterable *) .mets (mapcar* < function << iterable *) .mets (mappend* < function << iterable *) @@ -38161,6 +38162,12 @@ returned. The returned sequence is of the same kind as the leftmost input sequence, unless the accumulated values cannot be elements of that type of sequence, in which case a list is returned. +The functions +.code mapcar +and +.code map +are synonyms. + The .code mappend function works like |