I was looking at this question (here) and I tried to find any thing gives the opposite of Alternatives. In other words, some pattern matching function that gives true when expression matches ALL patterns. Is there any function for that?
For example:
x has to be Integer AND Real
The other thing is that from Mr.Wizard solution, suppose I want to make a rule in which x has to be Integer and Real and also x>10, how can I define that in external rule or pattern in one shot and use pattern test ? or pattern : ( for example to do something like this f[x_?match] or f[x:(pattern)])
I hope I made the question clear.
Thank you
IntegerandReal; those are two completely different heads. – J. M.'s missing motivation Jul 16 '15 at 07:23x_Integer /; x > 10works. – Szabolcs Jul 16 '15 at 07:53MatchQand&&in the rare cases when this is necessary. For example, require that a sequence contain botha,a,aanda,a,b, which may or may not be overlapping. Thenseq_ /; MatchQ[seq, {___, a,a,a, ___}] && MatchQ[seq, {___, a, a, b, ___}]. – Szabolcs Jul 16 '15 at 07:57