N.B. I have bitten the bullet, and I am going through Leonid Shifrin's "Mathematica Programming: An Advanced Introduction." (Which needs no introduction in this forum)
One question I have: could one establish that a symbol has a built-in rules, based on DownValues or related functions?
For example:
Unprotect[Sin]
Sin[x_Integer] := Sin[N[x]]
Protect[Sin]
Sin[1]
(* 0.841471 *)
DownValues[Sin]
(* HoldPattern[Sin[x_Integer]] :> Sin[N[x]] *)
Hey, where are the built-in rules for Sin?
DownValues,SubValuesetc, but they are not seen and not accessible from the top level. You may indirectly interact with them (and possibly change their behavior) usingBlock, and you can also see them in action sometimes when tracing evaluation withTraceInternal -> True, but this seems to be as much as one can say about them from the top-level. Some functions also do have some number of top-level rules - those usually have theReadProtectedattribute set. You can see those rules if you remove the attribute. – Leonid Shifrin Jul 07 '13 at 16:42