bug in the code of CompiledMethod >> =

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

bug in the code of CompiledMethod >> =

cdelaunay
try in a Pharo-1.0-10515-rc3 image :

|set|
set := Set new.
Collection withAllSubclasses do: [:aClass |
	set addAll: aClass methods
	].

It will raise an exception telling: "MessageNotUnderstood: ByteSymbol>>analogousCodeTo:".
Indeed, in the code of CompiledMethod >> = , the message 'analogousCodeTo:' is send to a 
symbol.

I opened an Issue:
http://code.google.com/p/pharo/issues/detail?id=2185


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Stéphane Ducasse
Thanks cyrille!

Stef

On Mar 22, 2010, at 2:33 PM, Cyrille Delaunay wrote:

> try in a Pharo-1.0-10515-rc3 image :
>
> |set|
> set := Set new.
> Collection withAllSubclasses do: [:aClass |
> set addAll: aClass methods
> ].
>
> It will raise an exception telling: "MessageNotUnderstood: ByteSymbol>>analogousCodeTo:".
> Indeed, in the code of CompiledMethod >> = , the message 'analogousCodeTo:' is send to a
> symbol.
>
>
> I opened an Issue:
> http://code.google.com/p/pharo/issues/detail?id=2185
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Eliot Miranda-2
In reply to this post by cdelaunay
Oops.  Find attached.

2010/3/22 Cyrille Delaunay <[hidden email]>
try in a Pharo-1.0-10515-rc3 image :

|set|
set := Set new.
Collection withAllSubclasses do: [:aClass |
	set addAll: aClass methods
	].

It will raise an exception telling: "MessageNotUnderstood: ByteSymbol>>analogousCodeTo:".
Indeed, in the code of CompiledMethod >> = , the message 'analogousCodeTo:' is send to a 
symbol.

I opened an Issue:
http://code.google.com/p/pharo/issues/detail?id=2185


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Object-analogousCodeTo.st (360 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Stéphane Ducasse
eliot

Your changes fixed some of the problems. Now I tried to fix the test testAnalogousCodeTo in MethodPropertiesTest and
the expression returns false.

(#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false

(#zork->'hello') = (#zork->'hello') -> true

Stef

On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:

> Oops.  Find attached.
>
> 2010/3/22 Cyrille Delaunay <[hidden email]>
> try in a Pharo-1.0-10515-rc3 image :
>
> |set|
> set := Set new.
> Collection withAllSubclasses do: [:aClass |
> set addAll: aClass methods
> ].
>
> It will raise an exception telling: "MessageNotUnderstood: ByteSymbol>>analogousCodeTo:".
> Indeed, in the code of CompiledMethod >> = , the message 'analogousCodeTo:' is send to a
> symbol.
>
>
> I opened an Issue:
> http://code.google.com/p/pharo/issues/detail?id=2185
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> <Object-analogousCodeTo.st>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Stéphane Ducasse
not sure that it does not introduce side effect but

Association>>isLiteral

        ^ self key isLiteral and: [self value isLiteral]

Fix the problem.

stef

On Mar 22, 2010, at 10:25 PM, Stéphane Ducasse wrote:

> eliot
>
> Your changes fixed some of the problems. Now I tried to fix the test testAnalogousCodeTo in MethodPropertiesTest and
> the expression returns false.
>
> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>
> (#zork->'hello') = (#zork->'hello') -> true
>
> Stef
>
> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>
>> Oops.  Find attached.
>>
>> 2010/3/22 Cyrille Delaunay <[hidden email]>
>> try in a Pharo-1.0-10515-rc3 image :
>>
>> |set|
>> set := Set new.
>> Collection withAllSubclasses do: [:aClass |
>> set addAll: aClass methods
>> ].
>>
>> It will raise an exception telling: "MessageNotUnderstood: ByteSymbol>>analogousCodeTo:".
>> Indeed, in the code of CompiledMethod >> = , the message 'analogousCodeTo:' is send to a
>> symbol.
>>
>>
>> I opened an Issue:
>> http://code.google.com/p/pharo/issues/detail?id=2185
>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> <Object-analogousCodeTo.st>_______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Eliot Miranda-2
In reply to this post by Stéphane Ducasse
 

On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse <[hidden email]> wrote:
eliot

Your changes fixed some of the problems. Now I tried to fix the test testAnalogousCodeTo in MethodPropertiesTest and
the expression returns false.

(#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false

(#zork->'hello') = (#zork->'hello') -> true

For me 

    #(#zork -> 'hello') size 3 

In Pharo is it true that

#(#zork -> 'hello') size 1

??!?!

In that case I would implement analogousCodeTo: in Association, e.g.

analogousCodeTo: anObject
    ^anObject class == self class
    and: [key = anObject key
    and: [value = anObject value]]


But if Association isn't a literal I would simply check MethodPropertiesTests.  It could be obsolete.


Stef

On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:

> Oops.  Find attached.
>
> 2010/3/22 Cyrille Delaunay <[hidden email]>
> try in a Pharo-1.0-10515-rc3 image :
>
> |set|
> set := Set new.
> Collection withAllSubclasses do: [:aClass |
>       set addAll: aClass methods
>       ].
>
> It will raise an exception telling: "MessageNotUnderstood: ByteSymbol>>analogousCodeTo:".
> Indeed, in the code of CompiledMethod >> = , the message 'analogousCodeTo:' is send to a
> symbol.
>
>
> I opened an Issue:
> http://code.google.com/p/pharo/issues/detail?id=2185
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> <Object-analogousCodeTo.st>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Nicolas Cellier
You might also want to check last code published in trunk.

Nicolas

2010/3/22 Eliot Miranda <[hidden email]>:

>
>
> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse
> <[hidden email]> wrote:
>>
>> eliot
>>
>> Your changes fixed some of the problems. Now I tried to fix the test
>> testAnalogousCodeTo in MethodPropertiesTest and
>> the expression returns false.
>>
>> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>>
>> (#zork->'hello') = (#zork->'hello') -> true
>
> For me
>     #(#zork -> 'hello') size 3
> In Pharo is it true that
> #(#zork -> 'hello') size 1
> ??!?!
> In that case I would implement analogousCodeTo: in Association, e.g.
> analogousCodeTo: anObject
>     ^anObject class == self class
>     and: [key = anObject key
>     and: [value = anObject value]]
>
> But if Association isn't a literal I would simply check
> MethodPropertiesTests.  It could be obsolete.
>>
>> Stef
>>
>> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>>
>> > Oops.  Find attached.
>> >
>> > 2010/3/22 Cyrille Delaunay <[hidden email]>
>> > try in a Pharo-1.0-10515-rc3 image :
>> >
>> > |set|
>> > set := Set new.
>> > Collection withAllSubclasses do: [:aClass |
>> >       set addAll: aClass methods
>> >       ].
>> >
>> > It will raise an exception telling: "MessageNotUnderstood:
>> > ByteSymbol>>analogousCodeTo:".
>> > Indeed, in the code of CompiledMethod >> = , the message
>> > 'analogousCodeTo:' is send to a
>> > symbol.
>> >
>> >
>> > I opened an Issue:
>> > http://code.google.com/p/pharo/issues/detail?id=2185
>> >
>> >
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > [hidden email]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>> >
>> > <Object-analogousCodeTo.st>_______________________________________________
>> > Pharo-project mailing list
>> > [hidden email]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Eliot Miranda-2


On Mon, Mar 22, 2010 at 2:54 PM, Nicolas Cellier <[hidden email]> wrote:
You might also want to check last code published in trunk.

I saw that.  You're eliminating closeTo: for float comparison which seems fine to me :)  Thanks Nicolas!
However, it is indicative that a recompile all is necessary after redefining the number scanning facilities.  I guess that this is part of the standard release build process.  If not, we should add it.
 

Nicolas

2010/3/22 Eliot Miranda <[hidden email]>:
>
>
> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse
> <[hidden email]> wrote:
>>
>> eliot
>>
>> Your changes fixed some of the problems. Now I tried to fix the test
>> testAnalogousCodeTo in MethodPropertiesTest and
>> the expression returns false.
>>
>> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>>
>> (#zork->'hello') = (#zork->'hello') -> true
>
> For me
>     #(#zork -> 'hello') size 3
> In Pharo is it true that
> #(#zork -> 'hello') size 1
> ??!?!
> In that case I would implement analogousCodeTo: in Association, e.g.
> analogousCodeTo: anObject
>     ^anObject class == self class
>     and: [key = anObject key
>     and: [value = anObject value]]
>
> But if Association isn't a literal I would simply check
> MethodPropertiesTests.  It could be obsolete.
>>
>> Stef
>>
>> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>>
>> > Oops.  Find attached.
>> >
>> > 2010/3/22 Cyrille Delaunay <[hidden email]>
>> > try in a Pharo-1.0-10515-rc3 image :
>> >
>> > |set|
>> > set := Set new.
>> > Collection withAllSubclasses do: [:aClass |
>> >       set addAll: aClass methods
>> >       ].
>> >
>> > It will raise an exception telling: "MessageNotUnderstood:
>> > ByteSymbol>>analogousCodeTo:".
>> > Indeed, in the code of CompiledMethod >> = , the message
>> > 'analogousCodeTo:' is send to a
>> > symbol.
>> >
>> >
>> > I opened an Issue:
>> > http://code.google.com/p/pharo/issues/detail?id=2185
>> >
>> >
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > [hidden email]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>> >
>> > <Object-analogousCodeTo.st>_______________________________________________
>> > Pharo-project mailing list
>> > [hidden email]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Stéphane Ducasse
In reply to this post by Nicolas Cellier
Where?

> You might also want to check last code published in trunk.
>
> Nicolas
>
> 2010/3/22 Eliot Miranda <[hidden email]>:
>>
>>
>> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse
>> <[hidden email]> wrote:
>>>
>>> eliot
>>>
>>> Your changes fixed some of the problems. Now I tried to fix the test
>>> testAnalogousCodeTo in MethodPropertiesTest and
>>> the expression returns false.
>>>
>>> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>>>
>>> (#zork->'hello') = (#zork->'hello') -> true
>>
>> For me
>>     #(#zork -> 'hello') size 3
>> In Pharo is it true that
>> #(#zork -> 'hello') size 1
>> ??!?!
>> In that case I would implement analogousCodeTo: in Association, e.g.
>> analogousCodeTo: anObject
>>     ^anObject class == self class
>>     and: [key = anObject key
>>     and: [value = anObject value]]
>>
>> But if Association isn't a literal I would simply check
>> MethodPropertiesTests.  It could be obsolete.
>>>
>>> Stef
>>>
>>> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>>>
>>>> Oops.  Find attached.
>>>>
>>>> 2010/3/22 Cyrille Delaunay <[hidden email]>
>>>> try in a Pharo-1.0-10515-rc3 image :
>>>>
>>>> |set|
>>>> set := Set new.
>>>> Collection withAllSubclasses do: [:aClass |
>>>>       set addAll: aClass methods
>>>>       ].
>>>>
>>>> It will raise an exception telling: "MessageNotUnderstood:
>>>> ByteSymbol>>analogousCodeTo:".
>>>> Indeed, in the code of CompiledMethod >> = , the message
>>>> 'analogousCodeTo:' is send to a
>>>> symbol.
>>>>
>>>>
>>>> I opened an Issue:
>>>> http://code.google.com/p/pharo/issues/detail?id=2185
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>>
>>>> <Object-analogousCodeTo.st>_______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Stéphane Ducasse
In reply to this post by Eliot Miranda-2
> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse <[hidden email]> wrote:
> eliot
>
> Your changes fixed some of the problems. Now I tried to fix the test testAnalogousCodeTo in MethodPropertiesTest and
> the expression returns false.
>
> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>
> (#zork->'hello') = (#zork->'hello') -> true
>
> For me
>
>     #(#zork -> 'hello') size 3
>
> In Pharo is it true that
>
> #(#zork -> 'hello') size 1

I get

        #(#zork -> 'hello') size  3

> In that case I would implement analogousCodeTo: in Association, e.g.
>
> analogousCodeTo: anObject
>     ^anObject class == self class
>     and: [key = anObject key
>     and: [value = anObject value]]
>
>
> But if Association isn't a literal I would simply check MethodPropertiesTests.  It could be obsolete.
>
>
> Stef
>
> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>
> > Oops.  Find attached.
> >
> > 2010/3/22 Cyrille Delaunay <[hidden email]>
> > try in a Pharo-1.0-10515-rc3 image :
> >
> > |set|
> > set := Set new.
> > Collection withAllSubclasses do: [:aClass |
> >       set addAll: aClass methods
> >       ].
> >
> > It will raise an exception telling: "MessageNotUnderstood: ByteSymbol>>analogousCodeTo:".
> > Indeed, in the code of CompiledMethod >> = , the message 'analogousCodeTo:' is send to a
> > symbol.
> >
> >
> > I opened an Issue:
> > http://code.google.com/p/pharo/issues/detail?id=2185
> >
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> > <Object-analogousCodeTo.st>_______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Stéphane Ducasse
In reply to this post by Nicolas Cellier
> On Mon, Mar 22, 2010 at 2:54 PM, Nicolas Cellier <[hidden email]> wrote:
> You might also want to check last code published in trunk.
>
> I saw that.  You're eliminating closeTo: for float comparison which seems fine to me :)  Thanks Nicolas!
> However, it is indicative that a recompile all is necessary after redefining the number scanning facilities.  I guess that this is part of the standard release build process.  If not, we should add it.


I saw the following but I could not see the float issue you mentioned. Where it is?


analogousCodeTo: aMethodProperties
        | bs |
        (aMethodProperties isKindOf: MethodProperties) ifTrue: [^aMethodProperties analogousCodeTo: self].
        (bs := self basicSize) ~= aMethodProperties basicSize ifTrue:
                [^false].
        1 to: bs do:
                [:i|
                ((self basicAt: i) analogousCodeTo: (aMethodProperties basicAt: i)) ifFalse:
                        [^false]].
        ^true

hasAtLeastTheSamePropertiesAs: aMethodProperties
        "Answer if the recever has at least the same properties as the argument.
         N.B. The receiver may have additional properties and still answer true."
        aMethodProperties keysAndValuesDo:
                [:k :v|
                (v isKindOf: Pragma)
                        "ifTrue: [Pragmas have already been checked]"
                        ifFalse: [
                                (self includes: k->v) ifFalse: [^false]]].
        ^true




On Mar 22, 2010, at 10:54 PM, Nicolas Cellier wrote:

> You might also want to check last code published in trunk.
>
> Nicolas
>
> 2010/3/22 Eliot Miranda <[hidden email]>:
>>
>>
>> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse
>> <[hidden email]> wrote:
>>>
>>> eliot
>>>
>>> Your changes fixed some of the problems. Now I tried to fix the test
>>> testAnalogousCodeTo in MethodPropertiesTest and
>>> the expression returns false.
>>>
>>> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>>>
>>> (#zork->'hello') = (#zork->'hello') -> true
>>
>> For me
>>     #(#zork -> 'hello') size 3
>> In Pharo is it true that
>> #(#zork -> 'hello') size 1
>> ??!?!
>> In that case I would implement analogousCodeTo: in Association, e.g.
>> analogousCodeTo: anObject
>>     ^anObject class == self class
>>     and: [key = anObject key
>>     and: [value = anObject value]]
>>
>> But if Association isn't a literal I would simply check
>> MethodPropertiesTests.  It could be obsolete.
>>>
>>> Stef
>>>
>>> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>>>
>>>> Oops.  Find attached.
>>>>
>>>> 2010/3/22 Cyrille Delaunay <[hidden email]>
>>>> try in a Pharo-1.0-10515-rc3 image :
>>>>
>>>> |set|
>>>> set := Set new.
>>>> Collection withAllSubclasses do: [:aClass |
>>>>       set addAll: aClass methods
>>>>       ].
>>>>
>>>> It will raise an exception telling: "MessageNotUnderstood:
>>>> ByteSymbol>>analogousCodeTo:".
>>>> Indeed, in the code of CompiledMethod >> = , the message
>>>> 'analogousCodeTo:' is send to a
>>>> symbol.
>>>>
>>>>
>>>> I opened an Issue:
>>>> http://code.google.com/p/pharo/issues/detail?id=2185
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>>
>>>> <Object-analogousCodeTo.st>_______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Nicolas Cellier
2010/3/23 Stéphane Ducasse <[hidden email]>:
>> On Mon, Mar 22, 2010 at 2:54 PM, Nicolas Cellier <[hidden email]> wrote:
>> You might also want to check last code published in trunk.
>>
>> I saw that.  You're eliminating closeTo: for float comparison which seems fine to me :)  Thanks Nicolas!
>> However, it is indicative that a recompile all is necessary after redefining the number scanning facilities.  I guess that this is part of the standard release build process.  If not, we should add it.
>
>
> I saw the following but I could not see the float issue you mentioned. Where it is?
>

It's in CompiledMethod >> #=

Note that Pharo has implemented different workaround for handling
cases like (Float class>#nan) =  (Float class>#nan) copy, but these
are fragile.
trunk implementation rely on (lit1 == lit2) to handle this case.

Nicolas

>
> analogousCodeTo: aMethodProperties
>        | bs |
>        (aMethodProperties isKindOf: MethodProperties) ifTrue: [^aMethodProperties analogousCodeTo: self].
>        (bs := self basicSize) ~= aMethodProperties basicSize ifTrue:
>                [^false].
>        1 to: bs do:
>                [:i|
>                ((self basicAt: i) analogousCodeTo: (aMethodProperties basicAt: i)) ifFalse:
>                        [^false]].
>        ^true
>
> hasAtLeastTheSamePropertiesAs: aMethodProperties
>        "Answer if the recever has at least the same properties as the argument.
>         N.B. The receiver may have additional properties and still answer true."
>        aMethodProperties keysAndValuesDo:
>                [:k :v|
>                (v isKindOf: Pragma)
>                        "ifTrue: [Pragmas have already been checked]"
>                        ifFalse: [
>                                (self includes: k->v) ifFalse: [^false]]].
>        ^true
>
>
>
>
> On Mar 22, 2010, at 10:54 PM, Nicolas Cellier wrote:
>
>> You might also want to check last code published in trunk.
>>
>> Nicolas
>>
>> 2010/3/22 Eliot Miranda <[hidden email]>:
>>>
>>>
>>> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse
>>> <[hidden email]> wrote:
>>>>
>>>> eliot
>>>>
>>>> Your changes fixed some of the problems. Now I tried to fix the test
>>>> testAnalogousCodeTo in MethodPropertiesTest and
>>>> the expression returns false.
>>>>
>>>> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>>>>
>>>> (#zork->'hello') = (#zork->'hello') -> true
>>>
>>> For me
>>>     #(#zork -> 'hello') size 3
>>> In Pharo is it true that
>>> #(#zork -> 'hello') size 1
>>> ??!?!
>>> In that case I would implement analogousCodeTo: in Association, e.g.
>>> analogousCodeTo: anObject
>>>     ^anObject class == self class
>>>     and: [key = anObject key
>>>     and: [value = anObject value]]
>>>
>>> But if Association isn't a literal I would simply check
>>> MethodPropertiesTests.  It could be obsolete.
>>>>
>>>> Stef
>>>>
>>>> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>>>>
>>>>> Oops.  Find attached.
>>>>>
>>>>> 2010/3/22 Cyrille Delaunay <[hidden email]>
>>>>> try in a Pharo-1.0-10515-rc3 image :
>>>>>
>>>>> |set|
>>>>> set := Set new.
>>>>> Collection withAllSubclasses do: [:aClass |
>>>>>       set addAll: aClass methods
>>>>>       ].
>>>>>
>>>>> It will raise an exception telling: "MessageNotUnderstood:
>>>>> ByteSymbol>>analogousCodeTo:".
>>>>> Indeed, in the code of CompiledMethod >> = , the message
>>>>> 'analogousCodeTo:' is send to a
>>>>> symbol.
>>>>>
>>>>>
>>>>> I opened an Issue:
>>>>> http://code.google.com/p/pharo/issues/detail?id=2185
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> [hidden email]
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>
>>>>>
>>>>> <Object-analogousCodeTo.st>_______________________________________________
>>>>> Pharo-project mailing list
>>>>> [hidden email]
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Mariano Martinez Peck
Hi. I am using Moose (an image that Cyrille Delaunay gave me) and I am having this problem.

Is there a ticket for this ? I don't see analogousCodeTo:   in  PharoCore-1.1-11336-UNSTABLE

should we integrate the fix ?

Thanks

Mariano

On Tue, Mar 23, 2010 at 12:55 PM, Nicolas Cellier <[hidden email]> wrote:
2010/3/23 Stéphane Ducasse <[hidden email]>:
>> On Mon, Mar 22, 2010 at 2:54 PM, Nicolas Cellier <[hidden email]> wrote:
>> You might also want to check last code published in trunk.
>>
>> I saw that.  You're eliminating closeTo: for float comparison which seems fine to me :)  Thanks Nicolas!
>> However, it is indicative that a recompile all is necessary after redefining the number scanning facilities.  I guess that this is part of the standard release build process.  If not, we should add it.
>
>
> I saw the following but I could not see the float issue you mentioned. Where it is?
>

It's in CompiledMethod >> #=

Note that Pharo has implemented different workaround for handling
cases like (Float class>#nan) =  (Float class>#nan) copy, but these
are fragile.
trunk implementation rely on (lit1 == lit2) to handle this case.

Nicolas

>
> analogousCodeTo: aMethodProperties
>        | bs |
>        (aMethodProperties isKindOf: MethodProperties) ifTrue: [^aMethodProperties analogousCodeTo: self].
>        (bs := self basicSize) ~= aMethodProperties basicSize ifTrue:
>                [^false].
>        1 to: bs do:
>                [:i|
>                ((self basicAt: i) analogousCodeTo: (aMethodProperties basicAt: i)) ifFalse:
>                        [^false]].
>        ^true
>
> hasAtLeastTheSamePropertiesAs: aMethodProperties
>        "Answer if the recever has at least the same properties as the argument.
>         N.B. The receiver may have additional properties and still answer true."
>        aMethodProperties keysAndValuesDo:
>                [:k :v|
>                (v isKindOf: Pragma)
>                        "ifTrue: [Pragmas have already been checked]"
>                        ifFalse: [
>                                (self includes: k->v) ifFalse: [^false]]].
>        ^true
>
>
>
>
> On Mar 22, 2010, at 10:54 PM, Nicolas Cellier wrote:
>
>> You might also want to check last code published in trunk.
>>
>> Nicolas
>>
>> 2010/3/22 Eliot Miranda <[hidden email]>:
>>>
>>>
>>> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse
>>> <[hidden email]> wrote:
>>>>
>>>> eliot
>>>>
>>>> Your changes fixed some of the problems. Now I tried to fix the test
>>>> testAnalogousCodeTo in MethodPropertiesTest and
>>>> the expression returns false.
>>>>
>>>> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
>>>>
>>>> (#zork->'hello') = (#zork->'hello') -> true
>>>
>>> For me
>>>     #(#zork -> 'hello') size 3
>>> In Pharo is it true that
>>> #(#zork -> 'hello') size 1
>>> ??!?!
>>> In that case I would implement analogousCodeTo: in Association, e.g.
>>> analogousCodeTo: anObject
>>>     ^anObject class == self class
>>>     and: [key = anObject key
>>>     and: [value = anObject value]]
>>>
>>> But if Association isn't a literal I would simply check
>>> MethodPropertiesTests.  It could be obsolete.
>>>>
>>>> Stef
>>>>
>>>> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
>>>>
>>>>> Oops.  Find attached.
>>>>>
>>>>> 2010/3/22 Cyrille Delaunay <[hidden email]>
>>>>> try in a Pharo-1.0-10515-rc3 image :
>>>>>
>>>>> |set|
>>>>> set := Set new.
>>>>> Collection withAllSubclasses do: [:aClass |
>>>>>       set addAll: aClass methods
>>>>>       ].
>>>>>
>>>>> It will raise an exception telling: "MessageNotUnderstood:
>>>>> ByteSymbol>>analogousCodeTo:".
>>>>> Indeed, in the code of CompiledMethod >> = , the message
>>>>> 'analogousCodeTo:' is send to a
>>>>> symbol.
>>>>>
>>>>>
>>>>> I opened an Issue:
>>>>> http://code.google.com/p/pharo/issues/detail?id=2185
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-project mailing list
>>>>> [hidden email]
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>>
>>>>>
>>>>> <Object-analogousCodeTo.st>_______________________________________________
>>>>> Pharo-project mailing list
>>>>> [hidden email]
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: bug in the code of CompiledMethod >> =

Stéphane Ducasse
Yes there is a ticket and I should take some time to get over that.
But if somebody has time.

Stef


> Hi. I am using Moose (an image that Cyrille Delaunay gave me) and I am having this problem.
>
> Is there a ticket for this ? I don't see analogousCodeTo:   in  PharoCore-1.1-11336-UNSTABLE
>
> should we integrate the fix ?
>
> Thanks
>
> Mariano
>
> On Tue, Mar 23, 2010 at 12:55 PM, Nicolas Cellier <[hidden email]> wrote:
> 2010/3/23 Stéphane Ducasse <[hidden email]>:
> >> On Mon, Mar 22, 2010 at 2:54 PM, Nicolas Cellier <[hidden email]> wrote:
> >> You might also want to check last code published in trunk.
> >>
> >> I saw that.  You're eliminating closeTo: for float comparison which seems fine to me :)  Thanks Nicolas!
> >> However, it is indicative that a recompile all is necessary after redefining the number scanning facilities.  I guess that this is part of the standard release build process.  If not, we should add it.
> >
> >
> > I saw the following but I could not see the float issue you mentioned. Where it is?
> >
>
> It's in CompiledMethod >> #=
>
> Note that Pharo has implemented different workaround for handling
> cases like (Float class>#nan) =  (Float class>#nan) copy, but these
> are fragile.
> trunk implementation rely on (lit1 == lit2) to handle this case.
>
> Nicolas
>
> >
> > analogousCodeTo: aMethodProperties
> >        | bs |
> >        (aMethodProperties isKindOf: MethodProperties) ifTrue: [^aMethodProperties analogousCodeTo: self].
> >        (bs := self basicSize) ~= aMethodProperties basicSize ifTrue:
> >                [^false].
> >        1 to: bs do:
> >                [:i|
> >                ((self basicAt: i) analogousCodeTo: (aMethodProperties basicAt: i)) ifFalse:
> >                        [^false]].
> >        ^true
> >
> > hasAtLeastTheSamePropertiesAs: aMethodProperties
> >        "Answer if the recever has at least the same properties as the argument.
> >         N.B. The receiver may have additional properties and still answer true."
> >        aMethodProperties keysAndValuesDo:
> >                [:k :v|
> >                (v isKindOf: Pragma)
> >                        "ifTrue: [Pragmas have already been checked]"
> >                        ifFalse: [
> >                                (self includes: k->v) ifFalse: [^false]]].
> >        ^true
> >
> >
> >
> >
> > On Mar 22, 2010, at 10:54 PM, Nicolas Cellier wrote:
> >
> >> You might also want to check last code published in trunk.
> >>
> >> Nicolas
> >>
> >> 2010/3/22 Eliot Miranda <[hidden email]>:
> >>>
> >>>
> >>> On Mon, Mar 22, 2010 at 2:25 PM, Stéphane Ducasse
> >>> <[hidden email]> wrote:
> >>>>
> >>>> eliot
> >>>>
> >>>> Your changes fixed some of the problems. Now I tried to fix the test
> >>>> testAnalogousCodeTo in MethodPropertiesTest and
> >>>> the expression returns false.
> >>>>
> >>>> (#zork->'hello') analogousCodeTo: (#zork->'hello')  -> false
> >>>>
> >>>> (#zork->'hello') = (#zork->'hello') -> true
> >>>
> >>> For me
> >>>     #(#zork -> 'hello') size 3
> >>> In Pharo is it true that
> >>> #(#zork -> 'hello') size 1
> >>> ??!?!
> >>> In that case I would implement analogousCodeTo: in Association, e.g.
> >>> analogousCodeTo: anObject
> >>>     ^anObject class == self class
> >>>     and: [key = anObject key
> >>>     and: [value = anObject value]]
> >>>
> >>> But if Association isn't a literal I would simply check
> >>> MethodPropertiesTests.  It could be obsolete.
> >>>>
> >>>> Stef
> >>>>
> >>>> On Mar 22, 2010, at 6:20 PM, Eliot Miranda wrote:
> >>>>
> >>>>> Oops.  Find attached.
> >>>>>
> >>>>> 2010/3/22 Cyrille Delaunay <[hidden email]>
> >>>>> try in a Pharo-1.0-10515-rc3 image :
> >>>>>
> >>>>> |set|
> >>>>> set := Set new.
> >>>>> Collection withAllSubclasses do: [:aClass |
> >>>>>       set addAll: aClass methods
> >>>>>       ].
> >>>>>
> >>>>> It will raise an exception telling: "MessageNotUnderstood:
> >>>>> ByteSymbol>>analogousCodeTo:".
> >>>>> Indeed, in the code of CompiledMethod >> = , the message
> >>>>> 'analogousCodeTo:' is send to a
> >>>>> symbol.
> >>>>>
> >>>>>
> >>>>> I opened an Issue:
> >>>>> http://code.google.com/p/pharo/issues/detail?id=2185
> >>>>>
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> Pharo-project mailing list
> >>>>> [hidden email]
> >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>>>
> >>>>>
> >>>>> <Object-analogousCodeTo.st>_______________________________________________
> >>>>> Pharo-project mailing list
> >>>>> [hidden email]
> >>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> Pharo-project mailing list
> >>>> [hidden email]
> >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>
> >>>
> >>> _______________________________________________
> >>> Pharo-project mailing list
> >>> [hidden email]
> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>
> >>
> >> _______________________________________________
> >> Pharo-project mailing list
> >> [hidden email]
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project