4
$\begingroup$

When I define functions in Mathematica like:

f[x_] := 3 
f[x_Integer] := 6

How is the value of f[6] determined?
It seems to be independent of the order they're defined (which would make the most sense). From my initial testing, it picks the most "restricted" definition, but the meaning of this is unclear if I used patterns like f[x_ /; x > 3]

Can anyone point me to any documentation/specification about this issue ?
I've looked unsuccessfully for a while.

$\endgroup$
1
  • 2
    $\begingroup$ Unfortunately this is not rigorously defined publicly. The best knowledge we have is available in the linked Q&A. $\endgroup$
    – Mr.Wizard
    Commented Dec 31, 2013 at 16:55

0

Browse other questions tagged or ask your own question.