[eeps] EEP XXX: Pattern-test operator
David Mercer
dmercer@REDACTED
Fri Apr 27 21:12:31 CEST 2012
On Apr 23, 2012, at 19:06, "Richard O'Keefe" <ok@REDACTED> wrote:
>
> On 24/04/2012, at 10:52 AM, Robert Virding wrote:
>
>> I have missed one part of the discussion here and that is about ?=:
>> why use ?= in a guard and not =, and what does ?= mean outside a
>> guard?
. . .
> The problem now is that EITHER
> f(X) when X = [] -> ...
>> f([])
> fails (because the match X = [] succeeds but has value [] which is
> taken as false in a guard) OR the behaviour of = in a guard is
> inconsistent with its behaviour in an expression.
Why not
> f(X = []) -> …
or
> f(X) when X =:= [] -> …
?
>
Cheers,
DBM
More information about the eeps
mailing list