On 22/08/2012 08:38, Gael Mulat wrote:
Thank you for these answers. It helps.
Still a question about nested patterns (e.g. case x of (0 | 1) => true | _ => false;). I understand this is an extension of the grammar provided by SML/NJ.
The code I'm trying to port to Poly/ML is big, and we have used nested patterns in a lot of functions for years.
We manage to compile with MLton thanks to a tool named "defunct" that makes some changes to come back to a more official grammar (nested patterns, nested functors...).
I would like to avoid using the defunct tool as I guess it would break the debugging in PolyML. Moreover, I find the SML code much easier to read with nested patterns, as it avoids duplicating the code!
Do you think it would be a good idea to extend Poly/ML to support nested patterns ? If so, do you think it would be reasonable effort to extend Poly/ML to support nested patterns ?
Over the years I've taken quite a strong line against extensions. The intention is that Poly/ML follows the Definition of Standard ML (Revised) i.e. ML97. That isn't to say that I couldn't be persuaded otherwise but I think it would require more than this.
David