Bill Allombert on Sat, 19 Sep 2015 12:29:41 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Set definition syntax


On Fri, Sep 18, 2015 at 04:23:48PM +0200, Josef Eschgfaeller wrote:
> Could one not allow also the syntax
> 
>     [x <- v | P(x)]
> 
> instead of  [x | x<-v, P(x)] ?
> 
> Don't know, of course, how difficult this is.

It is not difficult but this causes an ambiguity in the language,
because a<-w can also be read as a "<-" w or as a "<" "-" w so
[x <- v | x <- w ] could be parsed in two ways.
To avoid this, the current rule is that <- is parsed as "<-" only after a | or
a ";" inside a [] block.

Cheers,
Bill.