[cduce-users] default match policy not working in sequences

Alain Frisch Alain.Frisch at inria.fr
Thu Nov 4 00:57:41 CET 2004


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 ]

Yes.

> 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)

- express conditions about the tail:

    [ (A /[C;_] | B)  x::(C|D)* ]


but really:

3. it is the notation I use in my PhD manuscript (p 176 of
    the version you have)

4. I already commited it to the CVS

;-)


-- Alain



More information about the Cduce-users mailing list