在Mac上,F# Interactive在哪里?

4

在Windows上,F#交互式和F#编译器的可执行文件名为fsifsc。在使用Mono的Mac上,它们被称为fsharpifsharpc。为什么会这样呢?


由于某种原因,我找不到它们。它们位于/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/fsharp - Brett Rowberry
1
输入 which fsharpc 命令,which 将会告诉你该命令在你的路径中的位置。 - SushiHangover
2个回答

5

这些名称只是fsi.exefsc.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") "$@"

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接