开发者

What is the purpose of ?? in F#?

开发者 https://www.devze.com 2023-03-26 08:15 出处:网络
Section 3.6 (Symbolic Keywords) of The F# 2.0 Language Specification lists the symbolic keyword ?? (double question mark) as in use today (i.e., not as reserved for future use). What is its purpose? I

Section 3.6 (Symbolic Keywords) of The F# 2.0 Language Specification lists the symbolic keyword ?? (double question mark) as in use today (i.e., not as reserved for future use). What is its purpose? It is not mentioned in the Symbol and Operator Reference (F#) on msdn, it does not appear to be an OCAML symbol, and I have never seen an example where it is used.

Edit

One conceivable answer is that ?? is a symbolic keyword reserved for future开发者_StackOverflow中文版 use, which was accidentally placed in the list of symbolic keywords instead of future symbolic keywords. This would be strange, for two reasons:

  • The list of future symbolic keywords contains only two entries: ~ and `, and it is placed immediately under the other list. Future symbolic keywords are something very prominent, it is improbable that the spec writer simply forgot about it.
  • Section 3.7 (Symbolic Operators) states that no library- or user-defined symbolic operator must start with a question mark, except for the late binding operators ? and ?<-. Therefore, it does not make sense to even mention a future symbolic keyword named ??, as its introduction cannot possibly be a breaking change.


The spec only says it's treated as a keyword, which apparently does not necessitate its implementation.

0

精彩评论

暂无评论...
验证码 换一张
取 消