[Pharo-dev] killing all uses of caseOf: and caseOf:otherwise from the image

Frank Shearar frank.shearar at gmail.com
Thu Aug 1 07:15:49 EDT 2013


On 1 August 2013 12:13, Frank Shearar <frank.shearar at gmail.com> wrote:
> On 1 August 2013 12:07, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
>> Hi guys
>>
>> we should not use caseOf: in the image.
>> So I will start removing them.
>
> Other than switching on _type_, what is the problem?
>
> foo caseOf: {
>   [1] -> ['one'].
>   [2] -> ['two'].
> } otherwise: ['three']
>
> What's wrong with this?

I can see a reason for removing #caseOf:, precisely because it doesn't
force you to consider a failed match. (#caseOf:otherwise: is always
exhaustive, in other words.)

frank

>> Stef
>>




More information about the Pharo-dev mailing list