Currently I am studying Mathematica programming, and when I study pattern matching and replacement, I find it is quite similar to functions. So can we say "all functions in Mathematica are some kind of pattern-matching-and-replacement procedures"?
1 Answer
$\begingroup$
$\endgroup$
1
I wouldn't say all functions. For example, consider
f = Compile[{{x, _Real}}, x*x]
There aren't any replacement rules for f
in this case.
DownValues[f]
(* {} *)
-
1
DownValues
in the docs. $\endgroup$