Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 717 Bytes

elixir-metaprogramming.md

File metadata and controls

33 lines (25 loc) · 717 Bytes
title category
Elixir metaprogramming
Elixir

Kernel

Most of these magic is defined in Kernel.SpecialForms.

Pseudo-variables

__DIR__     # current dir
__MODULE__  # current module
__CALLER__  # caller of the function
Map.keys(__ENV__)
[:__struct__, :aliases, :context, :context_modules, :export_vars, :file,
 :function, :functions, :lexical_tracker, :line, :macro_aliases, :macros,
 :module, :requires, :vars]
__CALLER__.module |> Module.definitions_in |> IO.inspect
apply(Enum, :reverse, [[1, 2, 3]])