Skip to content

Commit

Permalink
Add support for ports to Elixir.Kernel.inspect
Browse files Browse the repository at this point in the history
Adds support for inspecting ports in Elixir, allows for `IO.puts("#{inspect(port)}")`, etc...

Signed-off-by: Winford <[email protected]>
  • Loading branch information
UncleGrumpy committed Jan 15, 2025
1 parent 44191fc commit 86a1d80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/exavmlib/lib/Kernel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ defmodule Kernel do
:erlang.pid_to_list(t)
|> :erlang.list_to_binary()

t when is_port(t) ->
:erlang.port_to_list(t)
|> :erlang.list_to_binary()

t when is_function(t) ->
:erlang.fun_to_list(t)
|> :erlang.list_to_binary()
Expand Down

0 comments on commit 86a1d80

Please sign in to comment.