Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

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

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #4 on issue 3224 by luc.fabresse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

some comments.

We must add a hash method on SourcedMethodReference.
I propose:

SourcedMethodReference>>hash
     "Answer a SmallInteger whose value is related to the receiver's  
identity."
     ^ super hash bitXor: self sourcePointer

All instances of SourcedMethodReference should (*must*) have a defined  
sourcePointer (not be nil) at instanciation time.
But it seems that it is not the case since some initializing methods from  
MethodReference are not redefined in SourcedMethodReference:

MethodReference>>setClass:methodSymbol:
MethodReference>>setClassAndSelectorIn:
MethodReference>>setClassSymbol:classIsMeta:methodSymbol:stringVersion:
MethodReference>>setClass:methodSymbol:stringVersion:

For example, in SystemNavigation a lot of methods use:

SourcedMethodReference new setClass: class methodSymbol: sel

which leave sourcePointer uninitialized.

Did these changes break some tests?



Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #5 on issue 3224 by Benjamin.VanRyseghem.Pharo: Migrating  
MethodReference to MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

Those methods are part of a messy interface and should be removed, I think  
that's why they hadn't be reimplemented :)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #6 on issue 3224 by luc.fabresse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

ok, so we must kill the senders.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #7 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

The problem is that MethodReference was also used to just be an object that  
represent a class name and a selector. In addition it was also used to wrap  
a compiledMethod and as such a compiledMethod got a sourcePointer (I image).




Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #8 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

The problem is that MethodReference was also used to just be an object that  
represent a class name and a selector. In addition it was also used to wrap  
a compiledMethod and as such a compiledMethod got a sourcePointer (I image).




Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #9 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

I have the impression that we should not convert everything to  
SourcedMethodReference blindy. but this is difficult to know what is doing  
what.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #10 on issue 3224 by Benjamin.VanRyseghem.Pharo: Migrating  
MethodReference to MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

We can blindly replace MethodReference by SourcedMethodReference in methods  
which create new objects, but as long as MethodReference objects are living  
in the system, we can't blindly replace the methods which use  
MethodReference objects ... Moreover, a lot of such method use methods like  
isKindOf: etc.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #11 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

Integrated the second files (dealing with SystemNavigation) comment


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #12 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

Here are new changeset breaking the tests but that should be used to make  
progress

Attachments:
        FixingMethodReference.1.cs  43.1 KB
        FixingMethodReference-AddOns.1.cs  1.7 KB


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #13 on issue 3224 by Benjamin.VanRyseghem.Pharo: Migrating  
MethodReference to MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

Here are two new change set which fix a little bit the SourceReference API  
and fix some tests.

The order matters.


With that, only two error tests left, but I do not know why

Attachments:
        FixingSourceReferenceChangingTimeStampIntoAString.1.cs  4.5 KB
        FixTestsForSourcedMethodReference.1.cs  2.4 KB


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #14 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

Benjamin should I load your cs in addition or just instead of the other  
ones.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #15 on issue 3224 by Benjamin.VanRyseghem: Migrating  
MethodReference to MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

In addition of your cs :)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #16 on issue 3224 by Benjamin.VanRyseghem.Pharo: Migrating  
MethodReference to MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

Here the cs to fix the last tests ^^

easy ^^

Attachments:
        FixTestsForSMR.3.cs  2.6 KB


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo

Comment #17 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3224 in pharo: Migrating MethodReference to MethodReferenceWithSource

pharo
Updates:
        Status: Closed

Comment #18 on issue 3224 by stephane.ducasse: Migrating MethodReference to  
MethodReferenceWithSource
http://code.google.com/p/pharo/issues/detail?id=3224

finalllllly
in 12303