diff options
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | match.c | 4 | ||||
-rw-r--r-- | txr.1 | 11 |
3 files changed, 11 insertions, 6 deletions
@@ -6079,7 +6079,7 @@ void eval_init(void) reg_fun(intern(lit("return*"), user_package), func_n2o(return_star, 1)); reg_fun(intern(lit("abscond*"), system_package), func_n2o(abscond_star, 1)); - reg_fun(intern(lit("match-fun"), user_package), func_n4(match_fun)); + reg_fun(intern(lit("match-fun"), user_package), func_n4o(match_fun, 2)); reg_fun(intern(lit("time"), user_package), func_n0(time_sec)); reg_fun(intern(lit("time-usec"), user_package), func_n0(time_sec_usec)); @@ -4557,10 +4557,12 @@ val match_filter(val name, val arg, val other_args) } } -val match_fun(val name, val args, val input, val files) +val match_fun(val name, val args, val input_in, val files_in) { val call = cons(name, args); val spec = cons(cons(call, nil), nil); + val input = default_bool_arg(input_in); + val files = default_bool_arg(files_in); val in_bindings = cdr(uw_get_match_context()); val data = if3(streamp(input), lazy_stream_cons(input), @@ -50264,7 +50264,7 @@ and .coNP Function @ match-fun .synb -.mets (match-fun < name < args < input << files ) +.mets (match-fun < name < args >> [ input <> [ files ]]) .syne .desc The @@ -50284,15 +50284,18 @@ pattern language, not \*(TL) and evaluated accordingly. The .meta input argument is a list of strings, which may be lazy. It represents the -lines of the text stream to be processed. +lines of the text stream to be processed. If omitted, it defaults to +.codn nil . The -.meta file +.meta files argument is a list of filename specifications, which follow the same conventions as files given on the \*(TX command line. If the pattern function uses the .code @(next) -directive, it can process these additional files. +directive, it can process these additional files. If this argument is +omitted, it defaults to +.codn nil . The .code match-fun |