Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Elixir是否有保存当前文件名的变量(ala Ruby’;s_uuufile_uuu)?_Elixir - Fatal编程技术网

Elixir是否有保存当前文件名的变量(ala Ruby’;s_uuufile_uuu)?

Elixir是否有保存当前文件名的变量(ala Ruby’;s_uuufile_uuu)?,elixir,Elixir,如何在Elixir中指定正在编译的当前文件?在Ruby中,我可以使用\uuu文件\uuu变量。长生不老药中有等效物吗 这是我的剧本: IO.puts “#{__FILE__}” 以下是输出: ** (CompileError) ModulesAndFunctions-7.exs:3: undefined function __FILE__/0 (elixir) expanding macro: Kernel.to_string/1 ModulesAndFunctions-7.e

如何在Elixir中指定正在编译的当前文件?在Ruby中,我可以使用
\uuu文件\uuu
变量。长生不老药中有等效物吗

这是我的剧本:

IO.puts “#{__FILE__}”
以下是输出:

** (CompileError) ModulesAndFunctions-7.exs:3: undefined function __FILE__/0
    (elixir) expanding macro: Kernel.to_string/1
    ModulesAndFunctions-7.exs:3: (file)

您只需使用

即可将您的答案更新为:
\uuuuu环境文件
请?