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 6659b44 commit 235d479Copy full SHA for 235d479
doc/Language/traps.pod6
@@ -82,7 +82,7 @@ A L<C<Match> will be C<Nil>|https://docs.perl6.org/language/regexes#Literals> if
82
83
=head2 Beware of empty "blocks"
84
85
-Brackets are used to declare blocks. However, empty brackets will
+Curly braces are used to declare blocks. However, empty curly braces will
86
declare a hash.
87
88
=begin code
@@ -92,6 +92,12 @@ $ = {…} # Block
92
$ = { } # Hash
93
=end code
94
95
+You can use the second form if you effectively want to declare an empty block:
96
+
97
+ my &does-nothing = {;};
98
+ say does-nothing(33);# OUTPUT: «Nil»
99
100
101
=head1 Objects
102
103
=head2 Assigning to attributes
0 commit comments