【发布时间】:2012-08-19 18:40:56
【问题描述】:
我在 Ubuntu 中使用 mono,并按照 here 的说明安装了 F#。 我还安装了fsharp mode for emacs,因此能够测试和编译简单的 F# 程序(都在 emacs F# 模式 REPL 上,还可以生成我在单声道下运行的可执行文件)。
但是,声明:
open System.Xml.Linq
在 emacs F# 模式 REPL 和从 bash shell 调用 fsharpc 时都失败并出现相同的错误:
error FS0039: The namespace 'Linq' is not defined
我在 SO for C# 中找到了 similar post,尽管使用“-r: System.Xml.Linq”的建议确实适用于从 shell 编译:
fsharpc -r:System.Xml.Linq.dll parseemails.fs
...我仍然不知道如何使 Linq 命名空间可用于 emacs F# 模式 REPL,因此我可以将它与 C-c C-e 评估一起使用。
【问题讨论】:
-
使用
#r "System.Xml.Linq.dll"有效吗?