在Windows上,F#交互式和F#编译器的可执行文件名为fsi
和fsc
。在使用Mono的Mac上,它们被称为fsharpi
和fsharpc
。为什么会这样呢?
在Windows上,F#交互式和F#编译器的可执行文件名为fsi
和fsc
。在使用Mono的Mac上,它们被称为fsharpi
和fsharpc
。为什么会这样呢?
这些名称只是fsi.exe
和fsc.exe
的Mono脚本包装器。
它们是基于CIL的相同的“exe”,通过sh
脚本封装,在mono
运行时中执行。如果需要,可以在所选shell中创建一些别名。
#!/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") "$@"
sudo ln -s /Library/Frameworks/Mono.framework/Versions/Current/Commands/fsharpi /Library/Frameworks/Mono.framework/Versions/Current/Commands/fsi
然后 fsi
应该可以工作了。如果不能,请确保上级目录在您的 PATH 中:echo $PATH
/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/fsharp
。 - Brett Rowberrywhich fsharpc
命令,which
将会告诉你该命令在你的路径中的位置。 - SushiHangover