macos – fsi可以在MAC OS上运行4.0运行时,如果是,我该如何配置它

有点自我解释……

尝试在FSI中访问4.0 dll时出现各种错误.因此,我认为上述问题是正确的,而不是通过每一个问题.

这是我的问题或多或少的转贴in F# on MAC OSX and Ubuntu I get an error running FSI in 4.0

谢谢

加里

编辑我正在尝试使用Mono 2.8和fsharp在MacBook上的演示中运行以下内容. (代码是由其他人选择的)

open System.Numerics
open System

let maxIteration = 100

let modSquared (c : Complex) = c.Real * c.Real + c.Imaginary * c.Imaginary

type MandelbrotResult = 
    | DidNotEscape
    | Escaped of int

let mandelbrot c =
    let rec mandelbrotInner z iterations =
        if(modSquared z >= 4.0) 
            then Escaped iterations
        elif iterations = maxIteration
            then DidNotEscape
        else mandelbrotInner ((z * z) + c) (iterations + 1)
    mandelbrotInner c 0

for y in [-1.0..0.1..1.0] do
    for x in [-2.0..0.05..1.0] do
        match mandelbrot (Complex(x, y)) with
        | DidNotEscape -> Console.Write "#"
        | Escaped _ -> Console.Write " "
    Console.WriteLine ()

最佳答案 我下载了ZIP二进制文件并尝试在MacOS上运行4.0版本.最初,我得到了与你相同的错误(找不到BigInteger).这可以通过添加-I命令行参数来修复,但后来又出现了另一个错误,我还不确定如何处理这个错误:

fsmac:fsharp4 tomas$mono Fsi.exe 
  -I:/Library/Frameworks/Mono.framework/Versions/2.8/lib/mono/4.0/

Microsoft (R) F# 2.0 Interactive build 4.0.30319.1
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> 
error FS0192: internal error: unreachable: GetGlobals

编辑这是另一个(不成功的)尝试.这看起来像Mono错误,因为Mono(运行时4.0)上似乎不存在UnsafeLoadFrom方法.至少,我在C#项目的MonoDevelop IDE中看不到它(当我将运行时改为4.0时)

fsmac:fsharp4 tomas$mono --runtime=v4.0.30319 Fsi.exe --noframework 
  -r:/Library/Frameworks/Mono.framework/Versions/2.8/lib/mono/4.0/mscorlib.dll 
  -r:FSharp.Core.dll 

Microsoft (R) F# 2.0 Interactive build 4.0.30319.1
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> Missing method System.Reflection.Assembly::UnsafeLoadFrom(string) in 
assembly /Library/Frameworks/Mono.framework/Versions/2.8/lib/mono/4.0/
mscorlib.dll, referenced in assembly /Users/tomas/Programs/fsharp4/
FSharp.Compiler.dll
点赞