diff options
-rw-r--r-- | eval.c | 10 | ||||
-rw-r--r-- | lib.c | 2 | ||||
-rw-r--r-- | lib.h | 2 | ||||
-rw-r--r-- | parser.y | 2 | ||||
-rw-r--r-- | txr.1 | 23 |
5 files changed, 27 insertions, 12 deletions
@@ -2498,7 +2498,7 @@ static val imp_list_to_list(val list) static val dot_to_apply(val form, val lisp1_p) { - if ((opt_compat && opt_compat <= 137) || proper_listp(form)) { + if ((opt_compat && opt_compat <= 137) || proper_list_p(form)) { return form; } else { val sym = car(form); @@ -2937,7 +2937,7 @@ static val me_op(val form, val menv) uses_or2; val dwim_body = rlcp_tree(cons(dwim_s, if3(or4(is_op, has_rest, ssyms, - null(proper_listp(body_trans))), + null(proper_list_p(body_trans))), body_trans, append2(body_trans, rest_gensym))), body_trans); @@ -4789,7 +4789,11 @@ void eval_init(void) reg_fun(intern(lit("consp"), user_package), func_n1(consp)); reg_fun(intern(lit("lconsp"), user_package), func_n1(lconsp)); reg_fun(intern(lit("listp"), user_package), func_n1(listp)); - reg_fun(intern(lit("proper-listp"), user_package), func_n1(proper_listp)); + { + val proper_list_p_f = func_n1(proper_list_p); + reg_fun(intern(lit("proper-listp"), user_package), proper_list_p_f); + reg_fun(intern(lit("proper-list-p"), user_package), proper_list_p_f); + } reg_fun(intern(lit("length-list"), user_package), func_n1(length_list)); reg_fun(intern(lit("mapcar"), user_package), func_n1v(mapcarv)); @@ -2571,7 +2571,7 @@ val listp(val obj) return if2(obj == nil || consp(obj), t); } -val proper_listp(val obj) +val proper_list_p(val obj) { while (consp(obj)) obj = cdr(obj); @@ -584,7 +584,7 @@ val consp(val obj); val lconsp(val obj); val atom(val obj); val listp(val obj); -val proper_listp(val obj); +val proper_list_p(val obj); val length_list(val list); val getplist(val list, val key); val getplist_f(val list, val key, loc found); @@ -1346,7 +1346,7 @@ static val define_transform(parser_t *parser, val define_form) return define_form; } - if (!proper_listp(params)) { + if (!proper_list_p(params)) { yyerr("invalid function parameter list"); return define_form; } @@ -15370,16 +15370,16 @@ For a description of the arguments, semantics and return value, refer to the .code replace function. -.coNP Functions @ listp and @ proper-listp +.coNP Functions @ listp and @ proper-list-p .synb .mets (listp << value ) -.mets (proper-listp << value ) +.mets (proper-list-p << value ) .syne .desc The .code listp and -.code proper-listp +.code proper-list-p functions test, respectively, whether .meta value is a list, or a proper list, and return @@ -15400,7 +15400,7 @@ The empty list is a list, and a cons cell is a list. The -.code proper-listp +.code proper-list-p function returns .code t only for proper lists. A proper list is @@ -15409,10 +15409,21 @@ either or a cons whose .code cdr is a proper list. -.code proper-listp +.code proper-list-p traverses the list, and its execution will not terminate if the list is circular. +Dialect Note: in \*(TX 137 and older, +.code proper-list-p +is called +.codn proper-listp . +The name was changed for adherence to conventions and compatibility with other +Lisp dialects, like Common Lisp. However, the function continues to be +available under the old name. Code that must run on \*(TX 137 and older +installations should use +.codn proper-listp , +but its use going forward is deprecated. + .coNP Function @ length-list .synb .mets (length-list << list ) @@ -40318,7 +40329,7 @@ substring matches. For instance is a possible completion for .codn list , as is -.codn proper-listp . +.codn proper-list-p . If no completions are found, then the BEL character is sent to the terminal to generate a beep or a visual alert indication. The listener returns to |