在Elixir中,如何指定正在编译的当前文件?在Ruby中,我可以使用__FILE__变量。在长生不老药中有类似的药吗?
这是我的剧本:
IO.puts “#{__FILE__}”这是输出:
** (CompileError) ModulesAndFunctions-7.exs:3: undefined function __FILE__/0
(elixir) expanding macro: Kernel.to_string/1
ModulesAndFunctions-7.exs:3: (file)发布于 2016-05-28 14:57:44
您可以简单地使用.file
https://stackoverflow.com/questions/37500054
复制相似问题