Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of ?? in F#?

Tags:

syntax

f#

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 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.
like image 292
Marc Sigrist Avatar asked Oct 25 '22 03:10

Marc Sigrist


1 Answers

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

like image 107
Daniel Avatar answered Oct 31 '22 10:10

Daniel