It would be useful to support concrete syntax for optional matches and builds. The optional match should perform a match of Some() and result in an unbound variable if there is None(). The build should try to build a Some() or create None() if that fails.

The contribution of this feature is that you don’t need to write separate rules for both cases. This is especially frustrating if there are several optional constructs in a single syntactical construct (e.g. a for loop). It’s tempting to fall back to abstract syntax in these cases.

This should be easy to implement. It probably introduces a special AST construct, similar to FromTerm, ToTerm and meta-var.

Submitted on 31 October 2004 at 19:15

On 31 October 2004 at 19:18 Jira commented:

STR-198, martin:
Maybe using None or Some is more attractive then using bound and unbound variables or success and failure.


On 28 April 2005 at 18:58 Jira commented:

STR-198, martin:
You can just do this in your embedding.

Log in to post comments