문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top