help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] Using Smalltalk as a scripting language


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Using Smalltalk as a scripting language
Date: Fri, 30 Oct 2009 00:12:10 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4

On 10/30/2009 12:09 AM, Roland Plüss wrote:
What exactly you mean with "moving"? I'm not referencing to data inside
the custom data area using pointers. Most of the time I simply store
there a pointer to the wrapped engine object. Sometimes it's two
pointers ( required if a non-ref-counted object is stored which is
located inside a ref-counted object so I store two pointers one with
ref-counting to guard the second non-ref-counted one ). So as long as
the data is just copied nothing bad should happen.

Yeah, that's fine.

Most likely you'd have a cCall for #initialize
anyway.  Having one for #new instead does not change much.

To my understanding ( from past smalltalk lectures at university where
we worked with Squeak ) #new is responsible for allocating an object
while #initialize or #init is responsible for setting up default values
for the newly created instance. Therefore I proposed #new. Unless that
is in GST this rule is slightly different.

Yes, my reasoning is: if you used CObject, you would have needed anyway a cCall to initialize the CObject. By not using CObject, you just need your cCall to determine the correct size of the object so you use #new. But it's not like one of the two is particularly more hackish.

Paolo




reply via email to

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