[cduce-users] default match policy not working in sequences
Giuseppe.Castagna at ens.fr
Thu Nov 4 01:32:47 CET 2004
Alain Frisch wrote:
> Giuseppe Castagna wrote:
>>>> [ A /(x:=1) | B /(x:=2) ] which accepts [ A B ] and binds x->1 or
>>>> x->2 according to the case.
>> I guess here you want to say that it accepts [ A | B ]
>> I may be wrong but it seems to me that /p would be useful only for p a
>> default pattern. So why not adding special syntax just for it?
> 1. we need a special syntax, so why not "/(x:=c)" ? I find it clearly
> express a "side-condition".
> 2. the more general /p can be useful in other circumstances:
> - reuse predefined types:
> [ <a>_ /A | <b>_ /B ] (where A and B are already defined)
I do not see any advantage here. This is equivalent to
[ <a>_ A | <b>_ B ]
> - express conditions about the tail:
> [ (A /[C;_] | B) x::(C|D)* ]
Yes this is an advantage. In any case I believe that / is not a good
syntax. Too close to difference, and field removal, and possible
confusion with projections. I know that we are running out of symbols
but we should pick a different one.
> but really:
> 3. it is the notation I use in my PhD manuscript (p 176 of
> the version you have)
Come-on, every reader will have commited suicide before arriving at page
176 (you may wonder why I am still alive) :-)
> 4. I already commited it to the CVS
I was pretty sure about it.
More information about the Cduce-users