How can I specify a pattern for an expression f for which say f[x,y] returns a value, ie is defined as a function taking two arguments.
let's say I have:
F[f_,l_List?MatrixQ]:= Map[f,l]
and I want to make sure that f is indeed a function returning values for an input of a certain pattern. say a list or a pair of numbers. How can I do that?
corollary question:
The definition function:
?myfunction
returns a list of substitution rules assigned to myfunction expression. Where does this function look up the these rules from? Is that Internal to Mathematica?
Fto be a list of numbers? – J. M.'s missing motivation Feb 14 '16 at 01:28g[x, y]for undefinedgnot admissible? – J. M.'s missing motivation Feb 14 '16 at 01:35MyFunction, and perform post-condition tests during such function's application, throwing an exception or returning$Failedfor errors, but that's still a run-time check only, plus the user would have to use this new datatype. – Leonid Shifrin Feb 14 '16 at 02:03