Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use :stdio instead of group_leader() as default device #5089

Merged
merged 1 commit into from Aug 3, 2016

Conversation

michalmuskala
Copy link
Member

As discussed on IRC, I'm opening this PR as a place for further discussion on the issue.

This commit basically reverts the change introduced in: 249f83e

Using :stdio gives us much better error in case the data is not
printable, and the function signature is more understandable when
accessed with h/1.

As an example of better error message let's look at the error before the change:

iex(1)> IO.puts([:io])
** (ArgumentError) argument error
    (stdlib) :io.put_chars(#PID<0.50.0>, :unicode, [[:io], 10])

And after:

iex(1)> IO.puts([:io])
** (ArgumentError) argument error
    (stdlib) :io.put_chars(:standard_io, :unicode, [[:io], 10])

Notice the device is a PID when using group_leader() and a more understandable atom when using :stdio.

\cc @fishcakez

Using :stdio gives us much better error in case the data is not
printable, and the function signature is more understandable when
accessed with h/1.
@josevalim
Copy link
Member

I am a strong no on this feature. This means that, if I use remote shell, IO.puts won't be sent to the proper node. Won't it?

@josevalim
Copy link
Member

I was wrong. :stdio is rewritten to group leader.

@josevalim josevalim merged commit 2bb0276 into elixir-lang:master Aug 3, 2016
@josevalim
Copy link
Member

❤️ 💚 💙 💛 💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants