[Cuis-dev] ifPresent/ifAbsent methods in SequenceableCollection (and other minimal improvements)
Juan Vuletich
juan at jvuletich.org
Tue Apr 7 08:24:01 PDT 2026
Hi Facu,
This is cool stuff! It is now at GitHub.
Thanks!
On 2026-04-04 2:41 PM, Facundo Javier Gelatti via Cuis-dev wrote:
> In some work I'm doing, I needed to use the #at:ifPresent:ifAbsent: on
> a SequenceableCollection, which I (wrongly) assumed was implemented
> (in a similar way in which it is available for Dictionaries). A
> SequenceableCollection only understands #at:ifAbsent:.
>
> I'm not sure if we want to add them, but I attach some changes to add
> #at:ifPresent: and #at:ifPresent:ifAbsent: to SequenceableCollection.
> The changes are based on the current methods of SequenceableCollection
> and Dictionary.
>
> I also corrected the method comment on
> Dictionary>>#at:ifPresent:ifAbsent:, and made minor style changes
> to SequenceableCollection>>#at:ifAbsent:.
>
> Note: I didn't know if it was better to implement both #at:ifPresent:
> and #at:ifAbsent: in terms of #at:ifPresent:ifAbsent:. I left them
> separate because I saw that in Dictionary they are not implemented
> that way.
>
> Cheers!
> Facu
>
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
More information about the Cuis-dev
mailing list