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

Proc.new has $nl parameter while everything else seems to have separate $nl-in and $nl-out #5809

Open
p6rt opened this issue Nov 19, 2016 · 1 comment
Labels
RFC Request For Comments

Comments

@p6rt
Copy link

p6rt commented Nov 19, 2016

Migrated from rt.perl.org#130136 (status was 'new')

Searchable as RT130136$

@p6rt
Copy link
Author

p6rt commented Nov 19, 2016

From @AlexDaniel

It seems like there is a lot of confusion going on with $nl vs
$nl-in/$nl-out. This is especially a problem given that things do not
complain if you pass a wrong named parameter to them (e.g. here nl is
ignored​: 「open nl => “\r” …」).

There was an issue with our docs (see
https://irclog.perlgeek.de/perl6/2016-11-19#i_13597877 ), which is now
fixed. However, once I started grepping our docs to see if there are any
other wrong mentions of $nl, I stumbled upon Proc.

From Proc source​: (
https://github.com/rakudo/rakudo/blob/nom/src/core/Proc.pm )​:

submethod BUILD(…, Str​:D :$nl = "\n", …) {
… … …
  $!in = IO​::Pipe.new(​:proc(self), :path(''), :$chomp, nl-out => $nl);
… … …
  $!out = IO​::Pipe.new(​:proc(self), :path(''), :$chomp, nl-in => $nl);
… … …
}

So it seems like Proc can perfectly accept separate nl-in and nl-out, but
for some reason it doesn't.

My idea is that we should change it everywhere to nl-in/nl-out for
consistency reasons. However, some sort backward compatibility thingy
should be implemented so that we don't break existing code.

@p6rt p6rt added the RFC Request For Comments label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

1 participant