summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-12 10:30:56 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-12 10:30:56 -0700
commit5e1226c161ac4dd114fa5071baa943f72b79741c (patch)
treef9e9faa76092c0e676f0261b338696e4fc97244b /match.c
parent0ceb62ad1eddfdc0ade20005829c845afec67d81 (diff)
downloadtxr-5e1226c161ac4dd114fa5071baa943f72b79741c.tar.gz
txr-5e1226c161ac4dd114fa5071baa943f72b79741c.tar.bz2
txr-5e1226c161ac4dd114fa5071baa943f72b79741c.zip
match-fun: make last two args optional.
* eval.c (eval_init): Update registration of match-fun. * match.c (match_fun): Do defaulting on third and fourth arg. * txr.1: Documenation updated.
Diffstat (limited to 'match.c')
-rw-r--r--match.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/match.c b/match.c
index 63cd572a..1283bd73 100644
--- a/match.c
+++ b/match.c
@@ -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),