Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[IO.open] make the $path optional
  • Loading branch information
moritz committed Jul 6, 2012
1 parent 6ec88fa commit 737fb0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/IO.pm
Expand Up @@ -88,8 +88,9 @@ class IO does IO::FileTestable {
has $.path;

proto method open(|$) { * }
multi method open($path, :$r, :$w, :$a, :$bin, :$chomp = Bool::True,
multi method open($path? is copy, :$r, :$w, :$a, :$bin, :$chomp = Bool::True,
:enc(:$encoding) = 'utf8') {
$path //= $.path;
my $mode = $w ?? 'w' !! ($a ?? 'wa' !! 'r');
# TODO: catch error, and fail()
nqp::bindattr(self, IO, '$!PIO',
Expand Down

0 comments on commit 737fb0f

Please sign in to comment.