Just augmenting Michael Rogers' answer with an example:
x = 7;
func1[x_] := x^2; (* SetDelayed used here. *)
func2[x_] = x^2; (* Set used here. *)
We can see the difference immediately in the DownValues
.
DownValues[func1]
(* {HoldPattern[func1[x_]] :> x^2} *)
DownValues[func2]
(* {HoldPattern[func2[x_]] :> 49} *)
We can see the difference by tracing evaluation.
Trace[func1[2]]
(* {func1[2], 2^2, 4} *)
Trace[func2[2]]
(* {func2[2], 49} *)
In func1
, the right hand side was not evaluated before creating DownValues
. In func2
the right hand side was evaluated before creating DownValues
.