Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!cs.utexas.edu!news.ti.com!ticipa!clw
From: clw@ticipa.pac.sc.ti.com (Chris Winemiller)
Subject: Re: newbie question: saving variables by value
Message-ID: <1995Apr1.055050.408@ticipa.pac.sc.ti.com>
Organization: None
Date: Sat, 1 Apr 1995 05:50:50 GMT
Lines: 23

Visual Smalltalk also produces #(1 2).

In article <Pine.A32.3.91.950331142016.16729K-100000@swim5.eng.sematech.org>
William D. Gooch writes:
>This is not the behavior I get in PPST - the result here is #(1 2).
>
>On Fri, 31 Mar 1995, Mark Bondurant wrote:
>
>> The problem:
>> 
>> 	| a b |
>> 
>> 	a := Array new: 2.
>> 	b := 1.
>> 	a at: 1 put: b.
>> 	b := 2.
>> 	a at: 2 put: b.
>> 	a
>> 	 #(2 2)
>> 
>> I want to put the value of b in the array, not a reference to it.
>> 
>> Mark
