在Windows上,F#Interactive和F#编译器的可执行文件分别命名为fsi
和fsc
。在装有Mono的Mac上,它们分别称为fsharpi
和fsharpc
。为什么会这样?
答案 0 :(得分:2)
这些名称只是fsi.exe
和fsc.exe
的Mono脚本包装。
它们是包裹在sh
脚本中的相同的基于CIL的“ exe”,以通过mono
运行时执行它们。如果需要,可以在选择的外壳中创建一些别名。
#!/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") "$@"
#!/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