SML是否支持对匹配表达式中的模式进行防护?

问题描述 投票:-1回答:1

我已经想到了类似于here中描述的F#机制的东西。在调查过程中,我没有发现有明确的说法,也没有。

syntax pattern-matching sml smlnj ml
1个回答
0
投票

1990年的标准ML的定义或1997年的标准ML的定义(修订)]都没有定义模式保护。

[有一些建议来支持它们-参见https://github.com/SMLFamily/Successor-ML/wiki/Summary-of-proposed-changes-但我认为唯一支持该实现的是'HaMLeT S'。特别是,MLton和SMLNJ似乎都不支持它们(分别参见http://mlton.org/SuccessorMLhttps://smlnj.org/doc/features.html)。

© www.soinside.com 2019 - 2024. All rights reserved.