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

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

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -