[eeps] EEP XXX: Pattern-test operator
Richard O'Keefe
ok@REDACTED
Mon Apr 16 02:53:33 CEST 2012
Let's see where we can get if we
(1) Fix the operand order to be compatible with =
(2) Fix the spelling of the operator to be something
that suggests matching and suggests testing (for
me, with the languages I am familiar with, ~
really doesn't do either)
(3) Spell out the semantics, specifically the escape/
propagation of bindings, clearly and explicitly.
Pattern ?= Expression
is a familiar operator (well, it is if you know Eiffel,
where it's called "assignment attempt") which addresses
(1) and (2). I've spent some time on (3), thought I was
getting close, and realised I'd failed. In
p(X) when Y ?= 10 div X orelse Y ?= oops ->
q(Y).
I definitely want Y to be visible in the body. With
p(X) when Y = 10 div X ; Y = oops -> q(Y).
the scope rules would have been very nearly automatic.
More information about the eeps
mailing list