On 2 July 2013 22:18, commits@source.squeak.org wrote:
Frank Shearar uploaded a new version of Multilingual to project The Trunk: http://source.squeak.org/trunk/Multilingual-fbs.164.mcz
==================== Summary ====================
Name: Multilingual-fbs.164 Author: fbs Time: 2 July 2013, 10:18:42.84 pm UUID: 83457f26-4043-914a-b92d-8b34b4a2b37e Ancestors: Multilingual-fbs.163
This nearly severs the Multilingual -> Morphic dependency.
=============== Diff against Multilingual-fbs.163 ===============
The last remaining dependency is:
LanguageEnvironment class >> startUp self clearDefault. Clipboard startUp. HandMorph startUp.
I am stumped as to how to preserve this behaviour and sever the dependency. Smalltalk at: #HandMorph is _not_ a solution. It makes things worse because you hide the dependency, but it's still there, ready to bite you at a random moment.
Inlining the above into Language class >> #startUp's call sites seems... undesirable.
Perhaps a startup registry, and HandMorph's and Clipboard's #initialize would say something like LanguageEnvironment registerForStartup: self ?
Thoughts?
frank
The last remaining dependency is:
LanguageEnvironment class >> startUp self clearDefault. Clipboard startUp. HandMorph startUp.
I am stumped as to how to preserve this behaviour and sever the dependency. Smalltalk at: #HandMorph is _not_ a solution. It makes things worse because you hide the dependency, but it's still there, ready to bite you at a random moment.
Not sure why it "hides it" since references to HandMorph would still find it. Would it still bite even with a guard?
(Smalltalk classNamed: #HandMorph) ifNotNil: [ : cls | cls startUp ]
I suppose if someone loaded Multilingual _first_ one could get bitten by not starting the Clipboard? Not sure about that..
Inlining the above into Language class >> #startUp's call sites seems... undesirable.
Perhaps a startup registry, and HandMorph's and Clipboard's #initialize would say something like LanguageEnvironment registerForStartup: self ?
What about Smalltalk addToStartupList:after:?
On 3 July 2013 02:46, Chris Muller asqueaker@gmail.com wrote:
The last remaining dependency is:
LanguageEnvironment class >> startUp self clearDefault. Clipboard startUp. HandMorph startUp.
I am stumped as to how to preserve this behaviour and sever the dependency. Smalltalk at: #HandMorph is _not_ a solution. It makes things worse because you hide the dependency, but it's still there, ready to bite you at a random moment.
Not sure why it "hides it" since references to HandMorph would still find it.
You couldn't use "class references" (alt-shift-n) to find the dependencies and the Dependency Browser wouldn't be able to find it.
Would it still bite even with a guard?
(Smalltalk classNamed: #HandMorph) ifNotNil: [ : cls | cls startUp ]
I suppose if someone loaded Multilingual _first_ one could get bitten by not starting the Clipboard? Not sure about that..
Yes. But also it's the wrong thing; the dependency is inverted. In order to support some new shiny feature that needs state reset when the LanguageEnvironment changes, I'd need to affect the base infrastructure. I guess what I'm looking for is a callback or announcement mechanism. "Hey guys, the LanguageEnvironment has changed", and then Clipboard and HandMorph can say "oh right, I must <insert state change>".
Inlining the above into Language class >> #startUp's call sites seems... undesirable.
Perhaps a startup registry, and HandMorph's and Clipboard's #initialize would say something like LanguageEnvironment registerForStartup: self ?
What about Smalltalk addToStartupList:after:?
It's not an image startUp thing, but rather LanguageEnvironment class
#startUp is called when the Locale changes, and a few other places.
frank
squeak-dev@lists.squeakfoundation.org