I tried to:
pid = spawn fn -> 1 + 2 end
IO.puts(pid)
IO.puts(IO.inspect(pid))
and both given a
** (Protocol.UndefinedError) protocol String.Chars not implemented for #PID<0.59.0>
There must be a way to get the "#PID<0.59.0>" representation of the pid
, since the REPL prints that #PID<0.59.0>
.
When you want to append it to a string (to display some extra details), you can use string interpolation:
pid = spawn(fn -> 1 + 2 end)
IO.puts "Pid: #{inspect pid}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With