Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start to move some methods in IO over to the Perl 6 setting, improvin…
…g error handling to be more in line with S32 along the way.
- Loading branch information
Showing
3 changed files
with
33 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
class IO is also { | ||
|
||
multi method close() is export { | ||
try { | ||
?$!PIO.close() | ||
} | ||
$! ?? fail($!) !! Bool::True | ||
} | ||
|
||
multi method print(*@items) is export { | ||
try { | ||
$!PIO.print($_) for @items; | ||
} | ||
$! ?? fail($!) !! Bool::True | ||
} | ||
|
||
multi method say(*@items) is export { | ||
my $print_res = self.print(|@items); | ||
if $print_res { | ||
try { | ||
$!PIO.print("\n"); | ||
} | ||
return $! ?? fail($!) !! Bool::True | ||
} | ||
else { | ||
return $print_res; | ||
} | ||
} | ||
|
||
} | ||
|
||
# vim: ft=perl6 |