Mac上的F#Interactive在哪里

时间:2018-10-24 01:52:55

标签: macos f# mono f#-interactive

在Windows上,F#Interactive和F#编译器的可执行文件分别命名为fsifsc。在装有Mono的Mac上,它们分别称为fsharpifsharpc。为什么会这样?

2 个答案:

答案 0 :(得分:2)

这些名称只是fsi.exefsc.exe的Mono脚本包装。

它们是包裹在sh脚本中的相同的基于CIL的“ exe”,以通过mono运行时执行它们。如果需要,可以在选择的外壳中创建一些别名。

/Library/Frameworks/Mono.framework/Versions/Current/Commands/fsharpc

#!/bin/sh
EXEC="exec "

if test x"$1" = x--debug; then
   DEBUG=--debug
   shift
fi

if test x"$1" = x--gdb; then
   shift
   EXEC="gdb --eval-command=run --args "
fi

if test x"$1" = x--valgrind; then
  shift
  EXEC="valgrind $VALGRIND_OPTIONS"
fi

# Beware this line must match the regular expression " (\/.*)\/fsi\.exe" when fsc.exe is fsi.exe.
# That's because the FSharp MonoDevelop addin looks inside the text of this script to determine the installation
# location of the default FSharp install in order to find the FSharp compiler binaries (see
# fsharpbinding/MonoDevelop.FSharpBinding/Services/CompilerLocationUtils.fs). That's a pretty unfortunate
# way of finding those binaries. And really should be changed.
$EXEC /Library/Frameworks/Mono.framework/Versions/5.16.0/bin/mono $DEBUG $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/fsharp/fsc.exe --exename:$(basename "$0") "$@"

/Library/Frameworks/Mono.framework/Versions/Current/Commands/fsharpi

#!/bin/sh
EXEC="exec "

if test x"$1" = x--debug; then
   DEBUG=--debug
   shift
fi

if test x"$1" = x--gdb; then
   shift
   EXEC="gdb --eval-command=run --args "
fi

if test x"$1" = x--valgrind; then
  shift
  EXEC="valgrind $VALGRIND_OPTIONS"
fi

# Beware this line must match the regular expression " (\/.*)\/fsi\.exe" when fsi.exe is fsi.exe.
# That's because the FSharp MonoDevelop addin looks inside the text of this script to determine the installation
# location of the default FSharp install in order to find the FSharp compiler binaries (see
# fsharpbinding/MonoDevelop.FSharpBinding/Services/CompilerLocationUtils.fs). That's a pretty unfortunate
# way of finding those binaries. And really should be changed.
$EXEC /Library/Frameworks/Mono.framework/Versions/5.16.0/bin/mono $DEBUG $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/fsharp/fsi.exe --exename:$(basename "$0") "$@"

答案 1 :(得分:0)

终端窗口中,带有bash shell:

sudo ln -s /Library/Frameworks/Mono.framework/Versions/Current/Commands/fsharpi /Library/Frameworks/Mono.framework/Versions/Current/Commands/fsi

然后fsi应该可以工作。如果没有,请确保上面的目录在您的PATH中:echo $PATH