[eeps] Multi-Parameter Typechecking BIFs
mats cronqvist
masse@REDACTED
Thu Feb 26 16:34:04 CET 2009
"David Mercer" <dmercer@REDACTED> writes:
> On Thursday, February 26, 2009 7:43 AM, mats cronqvist wrote:
>
>> ... I
>> suspect the pattern
>>
>> receive
>> Bla when G ->
>>
>> where G cannot be expressed as a match or a type check is rare.
>
> I cannot provide any statistics as to the frequency of its use, but,
> coincidentally, I wrote such a thing just yesterday:
>
> receive
> #request{request = {'read', Start, Len}}
> when bit_size(Buffer) >= Start + Len
> ->
> . . .
>
> Pushing that when clause into the handler would cause a message to be
> received that I did not (yet) want to receive.
Perhaps I should point out again that neither I, nor anyone else
that I know of, has actually proposed removing 'when'. It was just
an offhand remark in a different context.
mats
More information about the eeps
mailing list