Skip to content

Instantly share code, notes, and snippets.

@twined
Created December 9, 2014 09:19
Show Gist options
  • Save twined/3ba4de340849f8ec1856 to your computer and use it in GitHub Desktop.
Save twined/3ba4de340849f8ec1856 to your computer and use it in GitHub Desktop.
iex(14)> :dbg.tracer
{:ok, #PID<0.109.0>}
iex(15)> :dbg.p :all, :c
{:ok, [{:matched, :nonode@nohost, 39}]}
iex(16)> :dbg.tpl Z, :x
{:ok, [{:matched, :nonode@nohost, 4}, {:saved, :x}]}
iex(17)> struct(Z, Map.from_struct(%V{})
...(17)> )
(<0.54.0>) call 'Elixir.Z':'__struct__'()
(<0.54.0>) returned from 'Elixir.Z':'__struct__'/0 -> #{'__struct__' => 'Elixir.Z',
f0 => <<"asdfa">>,
f1 => 23}
(<0.54.0>) call 'Elixir.Z':'__struct__'()
(<0.54.0>) returned from 'Elixir.Z':'__struct__'/0 -> #{'__struct__' => 'Elixir.Z',
f0 => <<"asdfa">>,
f1 => 23}
%Z{f0: "ttt", f1: 9870}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment