Read Online
Download PDF
Additional resources
Revision history
Known typos/bugs
Report a bug
License terms
About the author
"node98_1.gif" "node98_2.gif" "node98_3.gif"

2.4.2      The difference between Set and SetDelayed : an example

Here is an example:













In both cases, an object (a or b) is assigned a random integer in the range 1 -10. But in the former case, it is computed at the moment of assignment and then is attached to <a>, while in the latter case it is recomputed afresh every time that b is called. We have also used one of the looping constructs Do, which we will cover shortly.

"node98_16.gif" "node98_17.gif" "node98_18.gif"

Created by Wolfram Mathematica 6.0  (05 February 2009) Valid XHTML 1.1!