在 Windows 上,F# Interactive 和 F# 编译器的可执行文件名为 fsi
和 fsc
。在使用 Mono 的 Mac 上,它们被称为 fsharpi
和 fsharpc
。这是为什么?
最佳答案
这些名称只是 fsi.exe
和 fsc.exe
的 Mono 脚本包装器。
它们是相同的基于 CIL 的“exe”,包装在 sh
脚本中,通过 mono
运行时执行它们。如果需要,可以在选择的 shell 中创建一些别名。
/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") "$@"
关于macos - Mac 上的 F# Interactive 在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52960053/