[plt-scheme] Explaining assignment

From: Marco Morazan (morazanm at gmail.com)
Date: Fri Feb 20 11:01:34 EST 2009

Dear All,

Part VII of HtDP introduces the concept of state variables and
explains set! as having the effect of changing the definitions of
state variables. It does not explicitly mention, however, that set!
(or assignment in general) is a means for functions to
communicate/share values with each other without having to call each
other to communicate values via arguments for parameters. Clearly,
when "memory" is implemented using state variables functions are
communicating/sharing values. Functions are communicating/sharing
values by changing definitions.

Is there a reason for not explicitly introducing the idea of
communicating/sharing values along with the idea of changing
definitions? Has anyone experimented with such an approach?




Posted on the users mailing list.