Immediate (=) and Delayed (:=) Assignment

When an "=" is used in an assignment, the current value of the right-hand-side is  assigned to the left-hand-side.

"index_103.gif"

"index_104.gif"

This assignment may not be very useful if we wanted to use the "current time" as a variable some time later.

"index_105.gif"

Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31
Sun 7 Sep 2008 11:48:31

Instead, what we probably want is to have the right-hand-side evaluated when it is used. This is delayed assignment (:=)

"index_106.gif"

"index_107.gif"

"index_108.gif"

Below, Pause is used in a compound statement to show that the value associated with theFlexibleDate is updating

"index_109.gif"

Sun 7 Sep 2008 11:48:32
Sun 7 Sep 2008 11:48:34
Sun 7 Sep 2008 11:48:37
Sun 7 Sep 2008 11:48:41
Spikey Created with Wolfram Mathematica 6