创建F#库时出错

时间:2011-07-24 22:44:50

标签: f#

我创建了一个新的F#库,其中包含以下表达式:

module Module1

let x =  2 + 2

尝试运行时,我收到错误

Unexpected start of structured construct in definition. Expected '=' or other token.

1 个答案:

答案 0 :(得分:3)

当你说“跑”时,你的意思是全选 - > ALT + ENTER发送给FSI?如果是这样,我认为这是你的问题。 FSI不处理文件级模块声明。您需要在将其发送到FSI时选择module Module1,或将其更改为模块表达式:

module Module1 =
    let x = 2 + 2