.BG
.FN amatch
.TL
Argument Matching
.CS
match.call(definition, call)
amatch(definition, call)
.AG definition
an S function.
.AG call
an unevaluated call to the function
given in `definition'.
.RT
`match.call' returns a version of `call' in which all the arguments are specified
by name.
Therefore, components of this object corresponding to argument names in the
definition will be the actual, unevaluated argument if one was given, or else
`NULL' (see the example below).
.PP
`amatch' returns
a list of all the arguments, matched as they would be by the evaluator if
the call were made to the function in `definition'.
The list is in the order the arguments appear in `definition'.
The value has attributes `names' and `missing' which give the formal
names of the arguments and tell whether the corresponding argument
was omitted from `call' (regardless of whether a default appears in the
definition).
.PP
Aside from its role in the semantic model, `amatch' is chiefly used by
functions that want to pre-match arguments in order to do something
special about evaluation.
Generally, `match.call' is the more convenient way to get at the explicit
argument expressions in a call.
Note that functions `sys.call' and `sys.function' are general ways to get at
a function's own call and definition.
.EX
.Si "# Return a matched version of the call as an attribute"
.Si "attr(value, "call") <- match.call(sys.function(), sys.call())"
.Si "return(value)


.Si "amatch(get,expression(get(""abc"",w=2)))"
$name:
[1] "abc"
$where:
[1] 2
.ne 2
$frame:
\&.Argument(, frame = NULL)
.ne 2
$mode:
\&.Argument(, mode = "any")

attr(, "missing"):
[1] F F T T
.KW programming
.WR
