Skip to content

Commit 48b97ca

Browse files
author
Jan-Olof Hendig
committed
Added docs for Baggy.Bool. timotimo++
1 parent 67244e4 commit 48b97ca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/Type/Baggy.pod

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,19 @@ Returns zero.
248248
my $breakfast = bag <eggs bacon>;
249249
say $breakfast.default; # 0
250250
251+
=head2 method Bool
252+
253+
Defined as:
254+
255+
method Bool(Baggy:D:) returns Bool:D
256+
257+
Returns C<True> if the invocant contains at least one element.
258+
259+
my $breakfast = ('eggs' => 1).BagHash;
260+
say $breakfast.Bool; # True (since we have one element)
261+
$breakfast<eggs> = 0; # weight == 0 will lead to element removal
262+
say $breakfast.Bool; # False
263+
251264
=head2 method Set
252265
253266
Defined as:

0 commit comments

Comments
 (0)