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

Popular posts from this blog

c# - Class in a list -

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

Jdbc Odbc Driver error -