New answers tagged argument-patterns
3
votes
In a function definition, how should I declare an XMLObject["Document"] argument?
This is a syntax issue with the pattern notation. Consider this from your f3:
...
1
vote
Accepted
In a function definition, how should I declare an XMLObject["Document"] argument?
You may use a pattern with a condition, like:
MatchQ[myXML, x_ /; Head[x] == XMLObject["Document"]]
True
With this you may then define e.g.:
...
Top 50 recent answers are included
Related Tags
argument-patterns × 169function-construction × 61
pattern-matching × 61
functions × 26
evaluation × 11
optional-arguments × 11
list-manipulation × 10
programming × 9
replacement × 8
options × 6
conditional × 6
rule × 6
calculus-and-analysis × 5
syntax × 5
core-language × 5
plotting × 4
expression-test × 4
attributes × 4
arguments × 4
numerics × 3
bugs × 3
expression-manipulation × 3
variable-definitions × 3
message-coding × 3
graphics × 2