Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Some more methods from Bool and Pair converted to Perl 6.
- Loading branch information
Showing
5 changed files
with
50 additions
and
78 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
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,26 @@ | ||
| class Bool is also { | ||
|
|
||
| =begin item ACCEPTS | ||
| =end item | ||
| method ACCEPTS($topic) { | ||
| return self; | ||
| } | ||
|
|
||
| =begin item perl | ||
| =end item | ||
| method perl() { | ||
| return self ?? 'Bool::True' !! 'Bool::False'; | ||
| } | ||
|
|
||
| =begin item pick | ||
| Returns True or False | ||
| =end item | ||
| method pick() { | ||
| return rand < 0.5 ?? Bool::True !! Bool::False; | ||
| } | ||
|
|
||
| } |
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