swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correction


From: Benedikt Stefansson
Subject: Correction
Date: Tue, 20 Aug 1996 18:18:01 -0700

Hi folks,

I stand corrected after exchanging a couple of messages with Sven. I
hadn't read the documentation for the create protocol and was thus
unaware of the fact that createBegin does not return an instance of the
object being created. In this example the middle three lines are would
refer to an intermediate object. The last line is essential for the
program to function correctly:

newArray = [Array createBegin: aZone];
  [newArray setInitialValue: aList];
  [newArray setDefaultMember: UnsetMember];
  [newArray setCount: [aList getCount] * 2 );
newArray = [newArray createEnd];  

I guess if one always uses the createBegin...createEnd structure this is
never an issue, but skipping createEnd (which returns the object that is
being created) might lead to some interesting and fun bugs. And God
knows we need more bugs in this world.

Regards,
-Benedikt.
PS. Further documentation can be found at:
http://www.santafe.edu/projects/swarm/release/swarmdocs/src/defobj/Create.html
or in your friendly neighbourhood Swarm installation.

----------------
Benedikt Stefansson                 address@hidden
Center for Computable Economics     Tel. (310) 825-1777
UCLA                                Fax. (310) 825-9528
Los Angeles, CA 90095-1477          http://cce.sscnet.ucla.edu


reply via email to

[Prev in Thread] Current Thread [Next in Thread]