Re: [Pharo-project] [squeak-dev] Re: Issue with traits
I've fixed this issue in Pharo a couple of months ago. CompiledMethods are not shared anymore, so methodClass returns the expected class. At the time I implemented traits (2004?), there were no method properties and hence sharing compiled methods worked -- of course except for super sends in which case the method was always recompiled (so the answer to Andreas' question below is b)). Cheers, Adrian On Oct 21, 2009, at 08:42 , Andreas Raab wrote:
Igor Stasenko wrote:
now what i found interesting: (ABBAB methodDict at: #foo) == (ABBAC methodDict at: #foo) but as side effect, we got this one: (ABBAB methodDict at: #foo) methodClass ==> ABBAC which i find a bit disturbing :(
Yes, seems wrong. VERY wrong. Try this:
Object subclass: #BaseA
BaseA>>foo ^42
Object subclass: #BaseB
BaseB>>foo ^13
And then create subclasses of BaseA and BaseB which use your trait and have the trait implementation use "^super foo". One of two things should happen:
a) They both return the same (incorrect) value (which would be expected if methodClass is the same). In this case it's just plain broken.
b) They both return different values, in which case there is code that handles super sends specifically and the sharing is simply an unnecessary optimization.
I hope it's the latter case which would mean you only need to throw out the test for super sends and do whatever that code was doing to begin with ;-)
Cheers, - Andreas
On 21.10.2009, at 09:41, Adrian Lienhard wrote:
I've fixed this issue in Pharo a couple of months ago. CompiledMethods are not shared anymore, so methodClass returns the expected class. At the time I implemented traits (2004?), there were no method properties and hence sharing compiled methods worked -- of course except for super sends in which case the method was always recompiled (so the answer to Andreas' question below is b)).
We did a small paper for this years ESUG that describes the changes. It will be online at esug.org soon with all the other papers. If somebody wants a copy, I can send it. Marcus -- Marcus Denker -- marcus@2denker.de http://www.2denker.de 2denker UG (haftungsbeschränkt) Sitz Köln Amtsgericht - Registergericht - Köln, HRB 65065 Geschäftsführer: Christian Denker und Dr. Marcus Denker
maybe someone should forward this to squeak-dev, I am not subscribed. Begin forwarded message:
From: Marcus Denker <denker@acm.org> Date: 21. Oktober 2009 11:13:01 GMT+02:00 To: Pharo-project@lists.gforge.inria.fr Cc: The general-purpose Squeak developers list <squeak-dev@lists.squeakfoundation.org
Subject: Re: [Pharo-project] [squeak-dev] Re: Issue with traits
On 21.10.2009, at 09:41, Adrian Lienhard wrote:
I've fixed this issue in Pharo a couple of months ago. CompiledMethods are not shared anymore, so methodClass returns the expected class. At the time I implemented traits (2004?), there were no method properties and hence sharing compiled methods worked -- of course except for super sends in which case the method was always recompiled (so the answer to Andreas' question below is b)).
We did a small paper for this years ESUG that describes the changes. It will be online at esug.org soon with all the other papers.
If somebody wants a copy, I can send it.
Marcus
-- Marcus Denker -- marcus@2denker.de http://www.2denker.de
2denker UG (haftungsbeschränkt) Sitz Köln Amtsgericht - Registergericht - Köln, HRB 65065 Geschäftsführer: Christian Denker und Dr. Marcus Denker
done 2009/10/21 Marcus Denker <denker@acm.org>
maybe someone should forward this to squeak-dev, I am not subscribed.
Begin forwarded message:
From: Marcus Denker <denker@acm.org> Date: 21. Oktober 2009 11:13:01 GMT+02:00 To: Pharo-project@lists.gforge.inria.fr Cc: The general-purpose Squeak developers list < squeak-dev@lists.squeakfoundation.org
Subject: Re: [Pharo-project] [squeak-dev] Re: Issue with traits
On 21.10.2009, at 09:41, Adrian Lienhard wrote:
I've fixed this issue in Pharo a couple of months ago. CompiledMethods are not shared anymore, so methodClass returns the expected class. At the time I implemented traits (2004?), there were no method properties and hence sharing compiled methods worked -- of course except for super sends in which case the method was always recompiled (so the answer to Andreas' question below is b)).
We did a small paper for this years ESUG that describes the changes. It will be online at esug.org soon with all the other papers.
If somebody wants a copy, I can send it.
Marcus
-- Marcus Denker -- marcus@2denker.de http://www.2denker.de
2denker UG (haftungsbeschränkt) Sitz Köln Amtsgericht - Registergericht - Köln, HRB 65065 Geschäftsführer: Christian Denker und Dr. Marcus Denker
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Cédrick
On 21.10.2009, at 11:13, Marcus Denker wrote:
On 21.10.2009, at 09:41, Adrian Lienhard wrote:
I've fixed this issue in Pharo a couple of months ago. CompiledMethods are not shared anymore, so methodClass returns the expected class. At the time I implemented traits (2004?), there were no method properties and hence sharing compiled methods worked -- of course except for super sends in which case the method was always recompiled (so the answer to Andreas' question below is b)).
We did a small paper for this years ESUG that describes the changes. It will be online at esug.org soon with all the other papers.
Here is the pdf: http://marcusdenker.de/publications/Duca09bTraitsAPI.pdf Marcus -- Marcus Denker -- marcus@2denker.de http://www.2denker.de
participants (3)
-
Adrian Lienhard -
Cédrick Béler -
Marcus Denker