Skip to content

Commit 2460f90

Browse files
committed
Merge branch 'master' of github.com:perl6/doc
2 parents 7dcccbe + 5f81319 commit 2460f90

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

lib/Type/List.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ prints
545545
546546
method rotor(*@cycle, Bool() :$partial)
547547
548-
Returns a list of list, which each sublist is made of elements of the
548+
Returns a list of lists, where each sublist is made up of elements of the
549549
invocant.
550550
551551
In the simplest case, C<@cycle> contains just one integer, in which case the

lib/Type/Mu.pod

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,42 @@ Takes the given item and passes it to the enclosing C<gather> block.
255255
take (1 .. $max-lotto-numbers).pick(1);
256256
}.say; #-> 32 22 1 17 32 9 (for example)
257257
258+
=head2 method so
259+
260+
method so()
261+
262+
Returns a C<Bool> value representing the logical non-negation of an
263+
expression. One can use this method similarly to the English sentence: "If
264+
that is B<so>, then do this thing". For instance,
265+
266+
my @args = <-a -e -b -v>;
267+
my $verbose-selected = any(@args) eq '-v' | '-V';
268+
if $verbose-selected.so {
269+
say "Verbose option detected in arguments";
270+
} #-> Verbose option detected in arguments
271+
272+
=head2 method not
273+
274+
method not()
275+
276+
Returns a C<Bool> value representing the logical negation of an expression.
277+
Thus it is the opposite of C<so>.
278+
279+
my @args = <-a -e -b>;
280+
my $verbose-selected = any(@args) eq '-v' | '-V';
281+
if $verbose-selected.not {
282+
say "Verbose option not present in arguments";
283+
} #-> Verbose option not present in arguments
284+
285+
Since there is also a prefix version of C<not>, the above code reads better
286+
like so:
287+
288+
my @args = <-a -e -b>;
289+
my $verbose-selected = any(@args) eq '-v' | '-V';
290+
if not $verbose-selected {
291+
say "Verbose option not present in arguments";
292+
} #-> Verbose option not present in arguments
293+
258294
=end pod
259295

260296
# vim: expandtab shiftwidth=4 ft=perl6

type-graph.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ role NumericEnumeration
215215
role StringyEnumeration
216216
class Enum does Associative
217217
class Pair is Enum
218+
class PairMap is Hash
218219
class EnumMap is Iterable is Cool does Associative
219220
class Stash is Hash
220221
class PseudoStash is EnumMap

0 commit comments

Comments
 (0)