title: Runtime code reflection in Elixir
body: <p>How does one extract the abstract syntax tree (AST) of a module or function at runtime in Elixir?</p>
  
  <p>Is there a way to do this in Elixir?</p>
  
  <pre><code>defmodule Car do
    def beep do
      :beep  
    end
  end
  
  iex &gt; Car."way to get the ast of the 'beep' function"
  {:def, [context: Elixir, import: Kernel],
   [{:beep, [context: ...], ...}, [do: :beep]]}
  </code></pre>