Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Put easier to understand example in toggle docs
  • Loading branch information
pmurias committed Oct 19, 2018
1 parent 71a6cc0 commit d4add06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/Type/Any.pod6
Expand Up @@ -823,8 +823,8 @@ L<Iterates|/routine/iterator> over the invocant, producing a L<Seq>, toggling
whether the received values are propagated to the result on and off, depending
on the results of calling L<Callables|/type/Callable> in C<@conditions>:
say ^10 .toggle: * < 4, * %% 2, &is-prime; # OUTPUT: «(0 1 2 3 6 7)␤»
say ^10 .toggle: :off, * > 4; # OUTPUT: «(5 6 7 8 9)␤»
say (1..15).toggle(* < 5, * > 10, * < 15) # OUTPUT: «(1 2 3 4 11 12 13 14)␤»
say (1..15).toggle(:off, * > 2, * < 5, * > 10, * < 15) # OUTPUT: «(3 4 11 12 13 14)␤»
Imagine a switch that's either on or off (C<True> or C<False>), and values are
produced if it's on. By default, the initial state of that switch is in "on"
Expand Down

0 comments on commit d4add06

Please sign in to comment.