First, let me point out that =
is shorthand for Set
and :=
for SetDelayed
; this facilitates searching the docs. Also, as Simon Woods points out in a comment to the question, there is a tutorialtutorial on this.
A simple way to avoid this is to simply use a formal symbolformal symbol:
As a final note, one may combine Set
and SetDelayed
to implement memoizationmemoization. Here is how to calculate a Fibonacci number recursively, with