Skip to content

Commit

Permalink
Revert potentially confusing "is default" changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jul 31, 2017
1 parent fbdbe6f commit a801627
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/core/IO/Handle.pm
Expand Up @@ -5,9 +5,9 @@ my class Proc { ... }
my class IO::Handle {
has $.path;
has $!PIO;
has $.chomp is rw is default(True);
has $.nl-in is default(["\x0A", "\r\n"]);
has Str:D $.nl-out is rw is default("\n");
has $.chomp is rw = Bool::True;
has $.nl-in = ["\x0A", "\r\n"];
has Str:D $.nl-out is rw = "\n";
has Str $.encoding;
has Encoding::Decoder $!decoder;
has Encoding::Encoder $!encoder;
Expand Down Expand Up @@ -191,8 +191,8 @@ my class IO::Handle {
},
STORE => -> $, $nl-in {
$!nl-in = $nl-in;
$!decoder && $!decoder.set-line-separators($!nl-in.list);
$!nl-in
$!decoder && $!decoder.set-line-separators($nl-in.list);
$nl-in
}
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/IO/Pipe.pm
Expand Up @@ -4,8 +4,8 @@ my class IO::Pipe is IO::Handle {
has $!on-write;
has $!on-close;
has $!on-native-descriptor;
has $!eof is default(False);
has $!closed is default(False);
has $!eof = False;
has $!closed = False;

method TWEAK(:$!on-close!, :$enc, :$bin, :$!on-read, :$!on-write,
:$!on-native-descriptor --> Nil) {
Expand Down
12 changes: 7 additions & 5 deletions src/core/IO/Socket.pm
@@ -1,8 +1,8 @@
my role IO::Socket {
has $!PIO;
has Str $.encoding is default('utf8');
has $.nl-in is rw is default(["\n", "\r\n"]);
has Str:D $.nl-out is rw is default("\n");
has Str $.encoding = 'utf8';
has $.nl-in is rw = ["\n", "\r\n"];
has Str:D $.nl-out is rw = "\n";
has Encoding::Decoder $!decoder;
has Encoding::Encoder $!encoder;

Expand Down Expand Up @@ -55,8 +55,10 @@ my role IO::Socket {
FETCH => { $!nl-in },
STORE => -> $, $nl-in {
$!nl-in = $nl-in;
$!decoder && $!decoder.set-line-separators($!nl-in.list);
$!nl-in
with $!decoder {
.set-line-separators($!nl-in.list);
}
$nl-in
}
)
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/IO/Socket/INET.pm
Expand Up @@ -24,9 +24,9 @@ my class IO::Socket::INET does IO::Socket {
has Int $.localport;
has Int $.backlog;
has Bool $.listening;
has $.family is default(PIO::PF_INET);
has $.proto is default(PIO::PROTO_TCP);
has $.type is default(PIO::SOCK_STREAM);
has $.family = PIO::PF_INET;
has $.proto = PIO::PROTO_TCP;
has $.type = PIO::SOCK_STREAM;

my sub split-host-port(:$host is copy, :$port is copy, :$family) {
if ($host) {
Expand Down
6 changes: 3 additions & 3 deletions src/core/Proc/Async.pm
Expand Up @@ -100,9 +100,9 @@ my class Proc::Async {
has $.path;
has @.args;
has $.w;
has $.enc is default('utf8');
has $.translate-nl is default(True);
has Bool $.started is default(False);
has $.enc = 'utf8';
has $.translate-nl = True;
has Bool $.started = False;
has $!stdout_supply;
has CharsOrBytes $!stdout_type;
has $!stderr_supply;
Expand Down

0 comments on commit a801627

Please sign in to comment.