[squeak-dev] The Inbox: Monticello-topa.490.mcz

Frank Shearar frank.shearar at gmail.com
Fri Dec 2 21:39:38 UTC 2011


On 2 December 2011 19:32, Tobias Pape <Das.Linux at gmx.de> wrote:
>
> Am 2011-12-02 um 18:54 schrieb Frank Shearar:
>
>> On 2 December 2011 15:44,  <commits at source.squeak.org> wrote:
>>> A new version of Monticello was added to project The Inbox:
>>> http://source.squeak.org/inbox/Monticello-topa.490.mcz
>>
>> Excellent! I've been hoping someone would do just this - it should
>> drastically reduce the time take to build a custom image.
>>
>>> ==================== Summary ====================
>>>
>>> Item was added:
>>> + ----- Method: MCMcdReader class>>loaderDiff (in category 'as yet unclassified') -----
>>> + loaderDiff
>>> +
>>> +       ^ 9999 -> [:reader | reader loadDiff]!
>>>
>>> Item was added:
>>> + ----- Method: MCMcdReader class>>loaderDiffBinary (in category 'as yet unclassified') -----
>>> + loaderDiffBinary
>>> +
>>> +       ^ 100 -> [:reader | reader loaderDiffBinary]!
>>
>> What are the magic numbers?
>
> Priority.
> I pulled them out of thin air.
> These associations are put into a sorted collection (sorted by priority)
> an then the blocks are tried in the order of the priorities until the
> first block does not yield nil.
>
> Hence, loaderDiffBinary is tried first, and if it does not succeed, loaderDiff is
> tried. 9999 is meant as last resort. I admit it is not that elaborated.
>
> Extension goes like this (tied to that example)
>
>>> + ----- Method: MCMcdReader class>>loaderDiffFuel (in category '*FuelMonticello') -----
>>> + loaderDiffFuel
>>> +
>>> +       ^ 10 -> [:reader | reader loadDiffFuel]!
>
>
> That way, Fuel is tried very first, then Binary (aka DataStream based), then loaderDiff (aka
> plain text definitions)

Ah, right: #allLoaderSelectors finds all the selectors called
loaderFoo and calls them in order. If two things have the same
priority, one or the other will go first, in a non-deterministic
fashion (or, rather, in whatever order #selectors finds them).

frank



More information about the Squeak-dev mailing list