[squeak-dev] The Inbox: Monticello-fbs.581.mcz

Frank Shearar frank.shearar at gmail.com
Mon Dec 23 15:22:54 UTC 2013


On 23 December 2013 08:24, Frank Shearar <frank.shearar at gmail.com> wrote:
> On 21 December 2013 22:44, Frank Shearar <frank.shearar at gmail.com> wrote:
>> On 21 December 2013 22:39,  <commits at source.squeak.org> wrote:
>>> A new version of Monticello was added to project The Inbox:
>>> http://source.squeak.org/inbox/Monticello-fbs.581.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Monticello-fbs.581
>>> Author: fbs
>>> Time: 21 December 2013, 8:00:04.242 pm
>>> UUID: 26fba6b3-441c-434b-9d61-e39955f4a5ca
>>> Ancestors: Monticello-cmm.580
>>>
>>> Make Monticello loading/unloading Environmentally aware. Loading Monticello definitions is as simple as
>>>
>>> ["loading logic here"]
>>>     on: EnvironmentRequest do: [:e | e resume: yourEnvironment].
>>>
>>> =============== Diff against Monticello-cmm.580 ===============
>>
>> | ctrl b |
>> Installer sm update.
>> ctrl := Environment withName: 'CtrlEnv'.
>> ctrl import: Smalltalk globals.
>> [Installer sm install: 'Control'] on: EnvironmentRequest do: [:e | e
>> resume: ctrl].
>> b := Browser new.
>> b selectEnvironment: ctrl.
>> Browser openBrowserView: (b openEditString: nil) label: 'Heehee'.
>>
>> Note how the Browser shows only those classes declared in the ctrl Environment.
>
> Actually, the above doesn't work because Installer sm uses a fileIn
> into a ChangeSet. At any rate, if you replace the "Installer sm
> install: 'Control'" line with your own favourite mcz in your package
> cache, things will work.

Like this:

| ctrl b |
Smalltalk globals exportSelf. "<-- only run this if you've not
previously done this or you'll be told that "Error: Cannot store into
read-only bindings"
ctrl := Environment withName: 'Control Env'.
ctrl import: Smalltalk globals.
[Installer ss3
    project: 'Control';
     install: 'Control-fbs.22'] on: EnvironmentRequest do: [:e | e
resume: ctrl].
b := Browser new
selectEnvironment: ctrl;
yourself.
Browser openBrowserView: (b openEditString: nil) label: b defaultBrowserTitle

Additionally, the submission as it stands breaks the "Changes" button.
If you load this mcz and try see, for example, what changes the Inbox
System-cmm.497.mcz will make, you'll get a KeyNotFound error because
there's no class called #Author in the current environment. (Indeed,
at this point NO environment has such a class.)

This happens, it seems, because the old MCMethodDefinition >>
#actualClass returns nil if it can't find a class. I really, really
hate this kind of thing: both returning nil, and _implicitly_
returning nil (because, you know, you haven't memorised the fact that
#at:ifPresent: returns nil if the key's missing).

At any rate, I'm not going to shave that particular yak yet, so just
imagine for the purposes of review that the block throwing the
KeyNotFound just has a non-local nil-return instead.

frank


More information about the Squeak-dev mailing list