[squeak-dev] The Inbox: Monticello-cmm.696.mcz
Chris Muller
asqueaker at gmail.com
Mon Apr 22 18:25:08 UTC 2019
Well, that's kind of embarassing, and unnecessary parentheses too.
Was doin' some last-minute tweaking, woops.
Yes, detectMax: is better. Fixed.
On Sun, Apr 21, 2019 at 9:26 PM Levente Uzonyi <leves at caesar.elte.hu> wrote:
>
> On Tue, 16 Apr 2019, commits at source.squeak.org wrote:
>
> > Chris Muller uploaded a new version of Monticello to project The Inbox:
> > http://source.squeak.org/inbox/Monticello-cmm.696.mcz
>
> snip
>
> >
> > =============== Diff against Monticello-nice.695 ===============
> >
> > Item was changed:
> > ----- Method: Class>>packageInfo (in category '*monticello') -----
> > packageInfo
> > + ^ ((PackageInfo allPackages select: [ : each | each includesClass: self ])
> > + ifEmpty: [ nil ]
> > + ifNotEmpty:
> > + [ : myPackages | "Select the most-qualified match."
> > + myPackages sort:
> > + [ : each | each packageName size ] descending ]) first!
>
> Haven't tried this one, but when there are no matching packages, #first
> with nil receiver will raise DNU.
> If you only need the largest value of a collection, then don't sort the
> collection and pick the first but use #detectMax: instead.
>
> > - ^ PackageInfo allPackages
> > - detect: [ : each | each includesClass: self ]
> > - ifNone: [ nil ]!
> >
>
> Levente
>
More information about the Squeak-dev
mailing list
|