Created
March 14, 2016 20:04
-
-
Save pavlos/637507cd3baaae4e1875 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defimpl Inspect, for: PID do def inspect(pid, _opts) do | |
"~P" <> :erlang.list_to_binary(:erlang.pid_to_list(pid)) end | |
end | |
defmodule SigilP do | |
defmacro sigil_P(term, modifiers) | |
defmacro sigil_P({:<<>>, _line, [string]}, []) when is_binary(string) do | |
"<#{string}>" |> String.to_char_list |> :erlang.list_to_pid | |
end | |
end | |
import SigilP | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment