[squeak-dev] The Trunk: Collections-cmm.785.mcz

Eliot Miranda eliot.miranda at gmail.com
Thu Apr 12 17:15:38 UTC 2018


Hi Chris,

On Fri, Mar 30, 2018 at 3:57 PM, <commits at source.squeak.org> wrote:

> Chris Muller uploaded a new version of Collections to project The Trunk:
> http://source.squeak.org/trunk/Collections-cmm.785.mcz
>
> ==================== Summary ====================
>
> Name: Collections-cmm.785
> Author: cmm
> Time: 30 March 2018, 5:57:37.727038 pm
> UUID: 37e9870a-5379-4185-8538-fada710dad5d
> Ancestors: Collections-eem.784
>
> Add #at:ifPresent:ifAbsent: for API compatibility with other kinds of
> directly-accessible Collections.
>
> =============== Diff against Collections-eem.784 ===============
>
> Item was added:
> + ----- Method: SequenceableCollection>>at:ifPresent:ifAbsent: (in
> category 'accessing') -----
> + at: index ifPresent: elementBlock ifAbsent: exceptionBlock
> +       "Answer the value of elementBlock on the element at position
> index.  If I do not contain an element at index, answer the result of
> evaluating exceptionBlock."
> +       ^ elementBlock value:
> +               (self
> +                       at: index
> +                       ifAbsent: [ ^ exceptionBlock value ])!
>

I'm thinking that this sits better in Collection as a default
implementation.  I note that also we don't have a subclass responsibility
implementations of at:ifAbsent: (and maybe others) in Collection.
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180412/becf77d3/attachment.html>


More information about the Squeak-dev mailing list