I've in mind something akin to the F# mechanism described here. In looking into it, I've found nothing explicitly saying it does nor that it doesn't.
Asked
Active
Viewed 318 times
0
-
This might have been a better question for the forums. – Michael Nelles Feb 06 '20 at 01:17
-
@nelles, why's that? – seconddayout Feb 06 '20 at 01:21
-
its not a bug related question or an error or some other anomaly. – Michael Nelles Feb 06 '20 at 01:23
-
@Nelles, also, what "forums"? – seconddayout Feb 06 '20 at 01:23
-
1@Nelles, seems that you're implying that the set of appropriate SO questions is limited to those that're about bugs or errors. Is that what's meant by what you've said and, if so, how do you figure that that's true? – seconddayout Feb 06 '20 at 01:29
-
No such thing just trying to be helpful – Michael Nelles Feb 06 '20 at 01:34
1 Answers
3
Neither the Definition of Standard ML from 1990 nor the Definition of Standard ML (Revised) from 1997 defines pattern guards.
There have been some proposals to support them — see https://github.com/SMLFamily/Successor-ML/wiki/Summary-of-proposed-changes — but I think the only implementation that does so is 'HaMLeT S'. In particular, neither MLton nor SMLNJ seems to support them (see http://mlton.org/SuccessorML and https://smlnj.org/doc/features.html, respectively).

ruakh
- 175,680
- 26
- 273
- 307
-
There is a paper and prototype for sml/nj given at last years ML workshop https://github.com/JohnReppy/compiling-pattern-guards which the paper says "We plan to incorporate it in a upcoming reimplementation of pattern matching in the Standard ML of New Jersey system" – matt Feb 06 '20 at 08:33