This is Devhints.io cheatsheets — a collection of cheatsheets I've written.

# Elixir metaprogramming

## Kernel

Most of these magic is defined in Kernel.SpecialForms.

### Pseudo-variables

    __DIR__     # current dir
    __MODULE__  # current module
    __CALLER__  # caller of the function

### `__ENV__`

    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]])

Devhints.io cheatsheets is a collection of cheatsheets I've written over the years. Suggestions and corrections? Send them in. I'm Rico Sta. Cruz. Check out my Today I learned blog for more.