Pregunta

I am trying to write F# parser. According to the specification the let expression looks like:

let value-defn in expr

I am using Try F# for testing. I tried following code which is parsed without error.

#light "off"
let a = 1

Yet according to the manual, should always contain in keyword. Why is it valid F# code?

¿Fue útil?

Solución

This is actually covered by another part of the spec (A.2.1.1)

module-function-or-value-defn :

  attributesopt let function-defn

  attributesopt let value-defn

Since you are defining something in a module directly, it doesn't need the in

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top