On 17 March 2012 17:26, Allen Wirfs-Brock <[email protected]> wrote:

> Also, I'm not sure that this usage would actually preclude :: also being
> used by guards .  :: as "prototype for" is a binary operator.  "::" as a
> guard designator is a suffix on a binding form. It isn't clear that there
> would be any syntactic ambiguities in those two contexts.
>
> let foo::bar=p::{};
>

That is not a future-proof assumption, because it is quite natural to allow
guards on arbitrary expressions:

  unguardedfoo(arg :: bar)

Also, with destructuring, you'll most likely have guards on subpatterns, so
the cover grammar has to handle them already.

In any case, I would find overloading the '::' notation like that too
confusing.

(OTOH, I'd prefer finding a way to do guards with single ':'... :-) )

/Andreas
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to