Issue 7114 in pharo: Association == doesn't work in workspace

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

Issue 7114 in pharo: Association == doesn't work in workspace

pharo
Status: HumanReviewNeeded
Owner: [hidden email]
Labels: Type-Bug Milestone-1.4 Milestone-2.0

New issue 7114 by [hidden email]: Association == doesn't work in  
workspace
http://code.google.com/p/pharo/issues/detail?id=7114

If in an workspace we try to evaluate:

a := Association new.
a key: 3.
a value: a.
a == a value.

the first time we get "true", the second we get an infinite loop...

A simple workaround is to declare "a":

|a|
a := Association new.
a key: 3.
a value: a.
a == a value.


Paste or attach stack trace if applicable (look at the file PharoDebug.log
located in the same directory as your image):


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

Re: Issue 7114 in pharo: Association == doesn't work in workspace

pharo
Updates:
        Labels: Difficulty-Easy

Comment #1 on issue 7114 by [hidden email]: Association == doesn't  
work in workspace
http://code.google.com/p/pharo/issues/detail?id=7114

seems to be solved by
Association>>= anAssociation
        ^ super = anAssociation
                and: [
                        value == anAssociation value
                                ifTrue: [ true ]
                                ifFalse: [ value = anAssociation value ] ]

I made a slice but it is buggy (it looks like I added a lot of method  
whereas I only modified the Association>>= method)


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

Re: Issue 7114 in pharo: Association == doesn't work in workspace

pharo

Comment #2 on issue 7114 by [hidden email]: Association == doesn't  
work in workspace
http://code.google.com/p/pharo/issues/detail?id=7114

Sorry, I disagree with the 'solution'.

The problem/issue is related to _how_ something is evaluated in a  
workspace. Apparently, some code cannot deal with the cycle in the  
datastructure. Maybe it tries printing, comparing or inspecting some object  
and gets into a loop.

Currently, any circular datastructure will get the system into a loop when  
printing or comparing it. Most of the time, inspecting works (unless  
printing is involved). This is the way it is, it is a system wide problem.  
It would be cool to solve this one day.

What the 'solution' actually does is fix the #= test for direct cycles in  
the value part by shortcutting the comparison immediately using #==. It is  
clever, but solves just one very particular case.

What about a loop in the key part ? What about a more indirect loop ?





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

Re: Issue 7114 in pharo: Association == doesn't work in workspace

pharo
Updates:
        Status: WorkNeeded

Comment #3 on issue 7114 by [hidden email]: Association == doesn't  
work in workspace
http://code.google.com/p/pharo/issues/detail?id=7114

Well I didn't think a lot I put the code from the mailing list, tried and  
it worked. There is certainly a better solution.


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

Re: Issue 7114 in pharo: Association == doesn't work in workspace

pharo
In reply to this post by pharo
Updates:
        Status: Invalid

Comment #5 on issue 7114 by [hidden email]: Association == doesn't  
work in workspace
http://code.google.com/p/pharo/issues/detail?id=7114

So this can be closed?


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