[Pharo-project] [squeak-dev] Re: [Vm-dev] Re: About ~= and ~~

Eliot Miranda eliot.miranda at gmail.com
Wed Oct 12 14:25:32 EDT 2011


OK, in the end I decided on primitive number 169. It doesn't waste the
150-159 range and is in amongst primitiveAdoptInstance and
primitiveSetIdentityHash.  David, would you like to integrate this into the
main branch?

On Wed, Oct 12, 2011 at 10:47 AM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

>
>
> On Wed, Oct 12, 2011 at 7:29 PM, Eliot Miranda <eliot.miranda at gmail.com>wrote:
>
>>
>>
>>
>> On Wed, Oct 12, 2011 at 10:26 AM, Mariano Martinez Peck <
>> marianopeck at gmail.com> wrote:
>>
>>>
>>>
>>>
>>> On Wed, Oct 12, 2011 at 6:44 PM, Eliot Miranda <eliot.miranda at gmail.com>wrote:
>>>
>>>>
>>>>
>>>>
>>>> On Wed, Oct 12, 2011 at 8:38 AM, Levente Uzonyi <leves at elte.hu> wrote:
>>>>
>>>>> On Wed, 12 Oct 2011, Clara Allende wrote:
>>>>>
>>>>>  Hi guys,
>>>>>>
>>>>>> I'm wondering, why?
>>>>>>
>>>>>> ProtoObject>> ~~ anObject
>>>>>>   "Answer whether the receiver and the argument are not the same
>>>>>> object
>>>>>>   (do not have the same object pointer)."
>>>>>>
>>>>>>   self == anObject
>>>>>>       ifTrue: [^ false]
>>>>>>       ifFalse: [^ true]
>>>>>>
>>>>>> Instead of:
>>>>>> ProtoObject>> ~~ anObject
>>>>>>   "Answer whether the receiver and the argument are not the same
>>>>>> object
>>>>>>   (do not have the same object pointer)."
>>>>>>
>>>>>>   ^(self == anObject) not
>>>>>>
>>>>>> And why?
>>>>>> Object >> ~= anObject
>>>>>>   "Answer whether the receiver and the argument do not represent the
>>>>>>   same object."
>>>>>>
>>>>>>   ^self = anObject == false
>>>>>>
>>>>>> Instead of
>>>>>> Object>> ~= anObject
>>>>>>   "Answer whether the receiver and the argument do not represent the
>>>>>>   same object."
>>>>>>
>>>>>>   ^(self = anObject) not.
>>>>>>
>>>>>> Is there any particular reason for this that I'm missing?
>>>>>>
>>>>>
>>>>> Performance.
>>>>>
>>>>
>>>> But better still is to add a ~~ primitive.  I did this for VisualWorks.
>>>>  e.g. primitive 150 is free.  why don't we use that for 1.4/4.3?
>>>>
>>>>
>>>
>>> with or without special bytecode associated?
>>>
>>
>> Initially without.
>>
>
> +1
>
>
>> Dynamic frequency is low, and primitive adds significant performance over
>> the non-primitive version.  One could use the blockCopy: special bytecode
>> but I'd wait until doing a complete bytecode set redesign.
>>
>>
>>>
>>>
>>>
>>>>
>>>>>
>>>>> Levente
>>>>>
>>>>>  Thanks in advance!
>>>>>> --
>>>>>>
>>>>>> "*Most good programmers do programming not because they expect to get
>>>>>> paid
>>>>>> or get adulation by the public, but because it is fun to program.*"
>>>>>>
>>>>>> Linus Torvalds
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> best,
>>>> Eliot
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>>
>>>
>>
>>
>> --
>> best,
>> Eliot
>>
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20111012/ccc3a1e1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: primitiveNotIdentical.st
Type: application/octet-stream
Size: 32572 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20111012/ccc3a1e1/attachment.st>


More information about the Pharo-dev mailing list