Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top