Login  Register

Re: Passed by references and by value

Posted by Clément Béra on Sep 26, 2014; 6:07am
URL: https://forum.world.st/Passed-by-references-and-by-value-tp4780289p4780375.html

Depending on the VM you use, different objects are passed by values.

Currently -> only smallintegers
on Spur 32 bits VM -> smallintegers and characters
on Spur 64 bits VM -> smallintegers, characters and smallfloat

But as Stef said it does not really matter in smalltalk. 

2014-09-25 21:55 GMT+02:00 nacho <[hidden email]>:
"
stepharo wrote
>> Hi,
>> In PBE says that ordinary objects' ivars are passed by references and
>> small
>> integers are passed by value.
>
> Strange I do not remember having written that.
> Especially because in Smalltalk this has no real interest.
>
>
> Well you also wrote that :p
>
> "Deep in the implementation of Smalltalk, there are three different kinds
> of objects. There are (1) ordinary objects with instance variables that
> are passed by references, there are (2) small integers that are passed by
> value, and there are (3) indexable objects like arrays that hold a
> contiguous portion of memory. The beauty of Smalltalk is that you normally
> don’t need to care about the differences between these three kinds of
> object.
>
>> Is there a way to know if a class is passed by reference or by value?
> In Smalltalk consider that everything is an object and that you pass a
> reference to the object.
>> Only small integers are passed as value?
>> Thanks in advance
>> Nacho
>>
>>
>>
>>
>>
>> -----
>> Nacho
>> Smalltalker apprentice.
>> Buenos Aires, Argentina.
>> --
>> View this message in context:
>> http://forum.world.st/Passed-by-references-and-by-value-tp4780289.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>
>>





-----
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
--
View this message in context: http://forum.world.st/Passed-by-references-and-by-value-tp4780289p4780321.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.