The Inbox: System-fbs.528.mcz

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

The Inbox: System-fbs.528.mcz

commits-2
Frank Shearar uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-fbs.528.mcz

==================== Summary ====================

Name: System-fbs.528
Author: fbs
Time: 9 May 2013, 10:39:54.298 pm
UUID: 4da211f7-b4fa-45b4-9560-f43e2c643510
Ancestors: System-fbs.527

SystemNavigation is one of the core parts of how Tools reflect on an image. This modest proposal introduces (partially) a means of making a SystemNavigation reflect on an Environment. It relies on Environments-fbs.27

=============== Diff against System-fbs.527 ===============

Item was changed:
  Object subclass: #SystemNavigation
+ instanceVariableNames: 'browserClass hierarchyBrowserClass environment'
- instanceVariableNames: 'browserClass hierarchyBrowserClass'
  classVariableNames: 'Default'
  poolDictionaries: ''
  category: 'System-Support'!
 
  !SystemNavigation commentStamp: 'mha 8/26/2010 09:02' prior: 0!
  I support the navigation of the system. I act as a facade but as I could require some state
  or different way of navigating the system all my behavior are on the instance side.
 
 
  For example if you want to look at all methods you have written or changed in the current image do
 
  SystemNavigation new browseAllSelect: [ :method |
         method fileIndex > 1 "only look at changes file"
         and: [ method timeStamp beginsWith: 'your-initials-here' ] ].
 
  !

Item was added:
+ ----- Method: SystemNavigation class>>for: (in category 'accessing') -----
+ for: anEnvironment
+ ^ self basicNew initializeWithEnvironment: anEnvironment.!

Item was changed:
  ----- Method: SystemNavigation>>allBehaviorsDo: (in category 'query') -----
  allBehaviorsDo: aBlock
  "Evaluate the argument, aBlock, for each kind of Behavior in the system
  (that is, Object and its subclasses and Traits).
  ar 7/15/1999: The code below will not enumerate any obsolete or anonymous
  behaviors for which the following should be executed:
 
  Smalltalk allObjectsDo:[:obj| obj isBehavior ifTrue:[aBlock value: obj]].
 
  but what follows is way faster than enumerating all objects."
 
+ self environment rootClasses do:
- Class rootsOfTheWorld do:
  [:root|
  root withAllSubclassesDo:
  [:class|
  class isMeta ifFalse: "The metaclasses are rooted at Class; don't include them twice."
  [aBlock value: class; value: class class]]].
  ClassDescription allTraitsDo: aBlock!

Item was added:
+ ----- Method: SystemNavigation>>environment (in category 'private') -----
+ environment
+ ^ environment ifNil: [environment := Smalltalk globals].!

Item was added:
+ ----- Method: SystemNavigation>>initializeWithEnvironment: (in category 'initialize-release') -----
+ initializeWithEnvironment: anEnvironment
+ self initialize.
+ environment := anEnvironment.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.528.mcz

Frank Shearar-3
On 9 May 2013 22:40,  <[hidden email]> wrote:

> Frank Shearar uploaded a new version of System to project The Inbox:
> http://source.squeak.org/inbox/System-fbs.528.mcz
>
> ==================== Summary ====================
>
> Name: System-fbs.528
> Author: fbs
> Time: 9 May 2013, 10:39:54.298 pm
> UUID: 4da211f7-b4fa-45b4-9560-f43e2c643510
> Ancestors: System-fbs.527
>
> SystemNavigation is one of the core parts of how Tools reflect on an image. This modest proposal introduces (partially) a means of making a SystemNavigation reflect on an Environment. It relies on Environments-fbs.27
>
> =============== Diff against System-fbs.527 ===============

I realise that this diff is not even close to being even partially a
fraction of what we need to do to this class and related bits. (For
instance, #allBehaviors should say "self environment allTraitsDo:"
instead of "ClassDescription allTraitsDo:" (and the latter ought to be
removed, along with Class class >> #rootsOfTheWorld).) The point of
the change is to ask the good folk of this list whether this is a sane
approach.

I've extended the patch locally, writing tests as I go. Turns out that
if you break SystemNavigation you hose yourself because the tools you
need to dig yourself back out are all broken. (It occurs to me that
perhaps Workspace would still work, so one could revert a method that
way... if one knew how off by heart.)

But I've managed to mostly avoid having to kill my image, and can use
"self environment" in a whole bunch of places.

frank

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.528.mcz

Colin Putney-3



On Fri, May 10, 2013 at 2:11 AM, Frank Shearar <[hidden email]> wrote:
 
 I realise that this diff is not even close to being even partially a
fraction of what we need to do to this class and related bits. (For
instance, #allBehaviors should say "self environment allTraitsDo:"
instead of "ClassDescription allTraitsDo:" (and the latter ought to be
removed, along with Class class >> #rootsOfTheWorld).) The point of
the change is to ask the good folk of this list whether this is a sane
approach.

I've extended the patch locally, writing tests as I go. Turns out that
if you break SystemNavigation you hose yourself because the tools you
need to dig yourself back out are all broken. (It occurs to me that
perhaps Workspace would still work, so one could revert a method that
way... if one knew how off by heart.)

But I've managed to mostly avoid having to kill my image, and can use
"self environment" in a whole bunch of places.

Bravo!

Sorry for the radio silence on this—life has been monopolizing my time lately. If you have any questions or need to prod me, it's best to CC me directly for the next couple of weeks. This is a really important bit of Environmentalization, so it's great to see it progressing.

Colin


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-fbs.528.mcz

Frank Shearar-3
On 15 May 2013 17:42, Colin Putney <[hidden email]> wrote:

>
>
>
> On Fri, May 10, 2013 at 2:11 AM, Frank Shearar <[hidden email]>
> wrote:
>
>>
>>  I realise that this diff is not even close to being even partially a
>> fraction of what we need to do to this class and related bits. (For
>> instance, #allBehaviors should say "self environment allTraitsDo:"
>> instead of "ClassDescription allTraitsDo:" (and the latter ought to be
>> removed, along with Class class >> #rootsOfTheWorld).) The point of
>> the change is to ask the good folk of this list whether this is a sane
>> approach.
>>
>> I've extended the patch locally, writing tests as I go. Turns out that
>> if you break SystemNavigation you hose yourself because the tools you
>> need to dig yourself back out are all broken. (It occurs to me that
>> perhaps Workspace would still work, so one could revert a method that
>> way... if one knew how off by heart.)
>>
>> But I've managed to mostly avoid having to kill my image, and can use
>> "self environment" in a whole bunch of places.
>
>
> Bravo!
>
> Sorry for the radio silence on this—life has been monopolizing my time
> lately. If you have any questions or need to prod me, it's best to CC me
> directly for the next couple of weeks. This is a really important bit of
> Environmentalization, so it's great to see it progressing.

So I can take it that I'm not going completely off the rails? :)

This stuff is quite... disruptive if you get it wrong, so I'd like to
see +1s before I commit to Trunk. Having said that, I would like to
push to Trunk with small patches, gradually making things more
environmentally aware. So if this particular batch of changes looks
sane, I'll push it, and leave the GetText/System changes to stew for
another few days before pushing those to Trunk.

frank

> Colin