Hi Simon,
On the other hand, a default case is necessary to keep match expressions small.
Would a keyword (like `else` or `otherwise` or `default`) be a suitable
alternative?
An alternative to what, though? What's the problem with just using a variable a pattern for the last case? Isn't that even more compact than otherwise
or default
? Or is the problem the burden of choosing the right name for the variable to avoid name clashes? (You have the same problem for any variable in a pattern anyway).
Could you clarify?
Thanks,
Cesare
--
You received this message because you are subscribed to a topic in the Google Groups "SMT-LIB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/smt-lib/ohNBx84mq9s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to smt-lib+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smt-lib/YFzrx%2BDxTs%2BoD/NV%40church.
Hi Simon,
Thanks for the clarification. I see now that your are not actually just proposing to introduce a keyword for the catch-all case; you are proposing the elimination of variables altogether as individual patterns. It is the latter that would make the match construct more robust.
I think you make a very good point. I also agree that it would be useful to have a designated symbol, ideally _
, for the "whatever" match inside a constructor pattern.
Since this change would not be backward compatible and we are close to releasing a first proposal for Version 3 of the language, I would be inclined to introduce the change in full in that version (especially the restriction on the patterns and the use of _
).
As an intermediate step, we could for now add a default
keyword for the catchall case and deprecate (but not disallow yet) the use of variables as a pattern.
How does that sound?
It'd be good to hear from others as well, especially on whether introducing a new keyword in Version 2.6 is worth the trouble and also on how to name it (default
, otherwise
, ...)
Best,
Cesare
--
You received this message because you are subscribed to a topic in the Google Groups "SMT-LIB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/smt-lib/ohNBx84mq9s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to smt-lib+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smt-lib/YJxTPj%2BY18NdZeGf%40church.