如何在Elixir中指定当前正在编译的文件?在Ruby中,我可以使用__FILE__
变量.Elixir中是否有相同的名称?
这是我的脚本:
IO.puts “#{__FILE__}”
Run Code Online (Sandbox Code Playgroud)
这是输出:
** (CompileError) ModulesAndFunctions-7.exs:3: undefined function __FILE__/0
(elixir) expanding macro: Kernel.to_string/1
ModulesAndFunctions-7.exs:3: (file)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
274 次 |
最近记录: |