Mac 上的 F# Interactive 在哪里

Where is F# Interactive on Mac

在 Windows,F# Interactive 和 F# Compiler 的可执行文件被命名为 fsifsc。在使用 Mono 的 Mac 上,它们被称为 fsharpifsharpc。这是为什么?

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

它们是相同的基于 CIL 的 "exe",封装在 sh 脚本中,通过 mono 运行时执行它们。如果需要,可以在选择的 shell 中创建一些别名。

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

#!/bin/sh
EXEC="exec "

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

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

if test x"" = 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 "[=10=]") "$@"

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

#!/bin/sh
EXEC="exec "

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

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

if test x"" = 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 "[=11=]") "$@"

终端window,与bashshell:

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

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