Does Elixir have a variable which holds the name of the current file (ala Ruby’s __FILE__)? -
how in elixir can specify current file being compiled? in ruby, can use __file__
variable. there equivalent in elixir?
here script:
io.puts “#{__file__}”
here output:
** (compileerror) modulesandfunctions-7.exs:3: undefined function __file__/0 (elixir) expanding macro: kernel.to_string/1 modulesandfunctions-7.exs:3: (file)
you can use __env__.file
Comments
Post a Comment