Issue 3704 in pharo: remove FakeClassPool adopt: and its senders

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

Issue 3704 in pharo: remove FakeClassPool adopt: and its senders

pharo
Status: Accepted
Owner: [hidden email]
Labels: Difficulty-Easy

New issue 3704 by [hidden email]: remove FakeClassPool adopt: and  
its senders
http://code.google.com/p/pharo/issues/detail?id=3704

As developped on following link, this message is useless
http://article.gmane.org/gmane.comp.lang.smalltalk.squeak.general/154929

The job is easy: if you see a sender of FakeClassPool adopt: then just  
remove it.

This is part of a larger plan, remove FakeClassPool itself since it's sole  
use is to flash a TextEditor when self is returned from a nil doItReceiver.

See also  
http://lists.squeakfoundation.org/pipermail/squeak-dev/2011-February/157518.html 
for a possible Comment Of The Day ;)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3704 in pharo: remove FakeClassPool adopt: and its senders

pharo
Updates:
        Status: FixProposed

Comment #1 on issue 3704 by [hidden email]: remove FakeClassPool  
adopt: and its senders
http://code.google.com/p/pharo/issues/detail?id=3704

**thanks**


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3704 in pharo: remove FakeClassPool adopt: and its senders

pharo

Comment #2 on issue 3704 by [hidden email]: remove FakeClassPool  
adopt: and its senders
http://code.google.com/p/pharo/issues/detail?id=3704

Name: Morphic-nice.519
Author: nice
Time: 14 February 2011, 10:22:53.154 pm
UUID: d83915ed-3966-4301-9439-0f94337843b6
Ancestors: Morphic-mtf.518

Get rid of FakeClassPool adopt:
RATIONALE:
1) this is useless
A FakeClassPool instance is used only in case of a nil #doItReceiver, so it  
is always adopting nil and does not pass any pool of interest.

2) this is useless
For a long time, the Compiler no longer needs a FakeClassPool instance in  
order to access the class and shared variables. Anyway, it was not a nice  
feature to use a global variable to pass states to the Compiler, was it ?

=============== Diff against Morphic-mtf.518 ===============

Item was changed:
  ----- Method: SmalltalkEditor>>tallySelection (in category 'do-its') -----
  tallySelection
        "Treat the current selection as an expression; evaluate it and  
return the time took for this evaluation"
        | result rcvr ctxt valueAsString v |
        self lineSelectAndEmptyCheck: [^ -1].

        (model respondsTo: #doItReceiver)
+               ifTrue: [ rcvr := model doItReceiver.
-               ifTrue: [FakeClassPool adopt: model  
selectedClass.  "Include model pool vars if any"
-                               rcvr := model doItReceiver.
                                ctxt := model doItContext]
                ifFalse: [rcvr := ctxt := nil].
        result := [ | cm |
                cm := rcvr class evaluatorClass new
                        compiledMethodFor: self selectionAsStream
                        in: ctxt
                        to: rcvr
                        notifying: self
                        ifFail: [FakeClassPool adopt: nil. ^ #failedDoit]
                        logged: false.
                Time millisecondsToRun:
                        [v := cm valueWithReceiver: rcvr arguments: #() ].
        ]
                on: OutOfScopeNotification
                do: [ :ex | ex resume: true].
-       FakeClassPool adopt: nil.

        "We do not want to have large result displayed"
        valueAsString := v printString.
        (valueAsString size > 30) ifTrue: [valueAsString := (valueAsString  
copyFrom: 1 to: 30), '...'].
        PopUpMenu
                inform: 'Time to compile and execute: ', result  
printString, 'ms res: ', valueAsString.
  !

Item was changed:
  ----- Method: TextEditor>>debugIt (in category 'do-its') -----
  debugIt

        | method receiver context |
        (model respondsTo: #doItReceiver)
                ifTrue:
+                       [receiver := model doItReceiver.
-                       [FakeClassPool adopt: model selectedClass.
-                       receiver := model doItReceiver.
                        context := model doItContext]
                ifFalse:
                        [receiver := context := nil].
        self lineSelectAndEmptyCheck: [^self].
        method := self compileSelectionFor: receiver in: context.
        method notNil ifTrue:
+               [self debug: method receiver: receiver in: context].!
-               [self debug: method receiver: receiver in: context].
-       FakeClassPool adopt: nil!

Item was changed:
  ----- Method: TextEditor>>evaluateSelection (in category 'do-its') -----
  evaluateSelection
        "Treat the current selection as an expression; evaluate it and  
return the result"
        | result rcvr ctxt |
        self lineSelectAndEmptyCheck: [^ ''].

        (model respondsTo: #doItReceiver)
+               ifTrue: [ rcvr := model doItReceiver.
-               ifTrue: [FakeClassPool adopt: model  
selectedClass.  "Include model pool vars if any"
-                               rcvr := model doItReceiver.
                                ctxt := model doItContext]
                ifFalse: [rcvr := ctxt := nil].
        result := [
                rcvr class evaluatorClass new
                        evaluate: self selectionAsStream
                        in: ctxt
                        to: rcvr
                        notifying: self
                        ifFail: [FakeClassPool adopt: nil. ^ #failedDoit]
                        logged: true.
        ]
                on: OutOfScopeNotification
                do: [ :ex | ex resume: true].
-       FakeClassPool adopt: nil.
        ^ result!



Reply | Threaded
Open this post in threaded view
|

Re: Issue 3704 in pharo: remove FakeClassPool adopt: and its senders

pharo
Updates:
        Status: Fixed

Comment #3 on issue 3704 by [hidden email]: remove FakeClassPool  
adopt: and its senders
http://code.google.com/p/pharo/issues/detail?id=3704

(No comment was entered for this change.)

Attachments:
        fullnameproblem.1.cs  1.2 KB


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3704 in pharo: remove FakeClassPool adopt: and its senders

pharo

Comment #4 on issue 3704 by [hidden email]: remove FakeClassPool  
adopt: and its senders
http://code.google.com/p/pharo/issues/detail?id=3704

(No comment was entered for this change.)

Attachments:
        fakePool.1.cs  4.6 KB


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3704 in pharo: remove FakeClassPool adopt: and its senders

pharo
Updates:
        Status: closed

Comment #5 on issue 3704 by [hidden email]: remove FakeClassPool  
adopt: and its senders
http://code.google.com/p/pharo/issues/detail?id=3704

13069