Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bool.succ, .pred methods explained (please review)
I first encountered the method "succ" today, and it was a method on Bool. At first I misunderstood it to mean "success", and wondered what type of failure or disaster "pred" stood for. Then I discovered that "succ" means "successor" and "pred" means "predecessor" and that they seem to totally make sense if we think of Bool in terms of it consisting of two possible enums.  So, that's what I tried to explain, but I would really like someone that feels more comfortable with this topic to please review my proposed changes (and please improve them if needed), before merging this pull request. (I could have committed directly, but I wanted someone to review this first.)
  • Loading branch information
molecules committed Jul 22, 2016
1 parent dc85695 commit 0b82fdd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/Type/Bool.pod6
Expand Up @@ -19,6 +19,8 @@ Returns C<True>.
say True.succ; # True
say False.succ; # True
succ is short for successor. In many languages, the succ function is used to return the "next" enum, also known as the successor. Bool is a special enum with only two values, C<False> and C<True>. When sorted, C<False> comes first, so C<True> is its successor. And since C<True> is the "highest" Bool enum, its own successor is also C<True>.
=head2 routine pred
method pred() returns Bool:D
Expand All @@ -28,6 +30,8 @@ Returns C<False>.
say True.pred; # False
say False.pred; # False
pred is short for predecessor. In many languages, the pred function is used to return the "previous" enum, also known as the predecessor. Bool is a special enum with only two values, C<False> and C<True>. When sorted, C<False> comes first, so C<False> is the predecessor to C<True>. And since C<False> is the "loweset" Bool enum, its own predecessor is also C<False>.
=head2 routine enums
method enums() returns Hash:D
Expand Down

0 comments on commit 0b82fdd

Please sign in to comment.