diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-08-07 13:13:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-08-07 13:13:50 -0700 |
commit | 78ab514b4f3b481ae006821520c6344768a529b3 (patch) | |
tree | c817b677932fec7e752ecb242f137c7f15661ba3 | |
parent | bde7b8dfe688ce05f445b5ed18f22d6b2a526c3a (diff) | |
download | txr-78ab514b4f3b481ae006821520c6344768a529b3.tar.gz txr-78ab514b4f3b481ae006821520c6344768a529b3.tar.bz2 txr-78ab514b4f3b481ae006821520c6344768a529b3.zip |
Make len a synonym for length.
* eval.c (eval_init): Register the same function under
length and len.
* txr.1: Documented.
-rw-r--r-- | eval.c | 4 | ||||
-rw-r--r-- | txr.1 | 8 |
2 files changed, 10 insertions, 2 deletions
@@ -5437,6 +5437,7 @@ void eval_init(void) val me_each_f = func_n2(me_each); val me_for_f = func_n2(me_for); val diff_f = func_n4o(set_diff, 2); + val length_f = func_n1(length); protect(&top_vb, &top_fb, &top_mb, &top_smb, &special, &builtin, &dyn_env, &op_table, &pm_table, &last_form_evaled, &last_form_expanded, @@ -6160,7 +6161,8 @@ void eval_init(void) reg_fun(intern(lit("uni"), user_package), func_n4o(uni, 2)); reg_fun(intern(lit("seqp"), user_package), func_n1(seqp)); - reg_fun(intern(lit("length"), user_package), func_n1(length)); + reg_fun(intern(lit("length"), user_package), length_f); + reg_fun(intern(lit("len"), user_package), length_f); reg_fun(intern(lit("empty"), user_package), func_n1(empty)); reg_fun(intern(lit("copy"), user_package), func_n1(copy)); reg_fun(intern(lit("sub"), user_package), func_n3o(sub, 1)); @@ -25391,9 +25391,10 @@ A sequence is defined as a list, vector or string. The object denotes the empty list and so is a sequence. -.coNP Function @ length +.coNP Functions @ length and @ len .synb .mets (length << object ) +.mets (len << object ) .syne .desc If @@ -25403,6 +25404,11 @@ is a sequence, the function returns the number of items it contains. +The +.code len +function is a synonym of +.codn length . + The function supports these additional types: .RS .coIP hash |