We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67244e4 commit 48b97caCopy full SHA for 48b97ca
doc/Type/Baggy.pod
@@ -248,6 +248,19 @@ Returns zero.
248
my $breakfast = bag <eggs bacon>;
249
say $breakfast.default; # 0
250
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
264
=head2 method Set
265
266
Defined as:
0 commit comments