Skip to content

Commit be25007

Browse files
committed
Adding examples of multi-line pod declarator blocks.
This would close #2035
1 parent c6159f8 commit be25007

File tree

3 files changed

+18
-23
lines changed

3 files changed

+18
-23
lines changed

doc/Language/pod.pod6

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,32 +139,26 @@ say &duel.WHY.leading; # OUTPUT: «Fight mechanics␤»
139139
say &duel.WHY.trailing; # OUTPUT: «Magicians only, no mortals.␤»
140140
=end code
141141
142-
=head2 Embedded and multi-line comment blocks
142+
These declarations can extend multiple blocks:
143143
144-
You can embed comments in code by using a hash followed by a backtick C<#`> and any bracketing construct. Although these constructs are similar in syntax to the ones above, they will produce no output when run through C<perl6 --doc>, so they are simply comments.
145-
146-
=begin code
147-
my $this-is-true = True;
148-
say "Yay" if #`[ wait for it ] $this-is-true; # OUTPUT: «Yay␤»
149-
=end code
150-
151-
You can embed these comments in expressions, as long as you don't insert them in the middle of keywords or identifiers.
152-
153-
These comments can extend multiple lines
154144
=begin code
155-
with (^33).grep( /^2/ ) { #`( This is an example of stringification:
145+
#|( This is an example of stringification:
156146
* Numbers turn into strings
157147
* Regexes operate on said strings
158148
* C<with> topicalizes and places result into $_
159-
) my @results = $_<>; #`« Uses
149+
)
150+
sub search-in-seq( Int $end, Int $number ) {
151+
with (^$end).grep( /^$number/ ) {
152+
.say for $_<>;
153+
}
154+
}
155+
#=« Uses
160156
* topic
161157
* decont operator
162158
»
163-
.say for @results;
164-
}
165159
=end code
166160
167-
In the examples above, we are using C<()> and C<«»> as delimiters in a multi-line comment block.
161+
By using a matched pair of parentesis constructs such as C<()> or C<«»> the comments can extend multiple lines. This format, however, will not translate to a multi-line display by C<perl6 -doc>.
168162
169163
=head1 Block types
170164

doc/Language/syntax.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ say "No more";
194194
Brackets inside the comment can be nested, so in C<#`{ a { b } c }>, the
195195
comment goes until the very end of the string. You may also use more complex
196196
brackets, such as C<#`{{ double-curly-brace }}>, which might help disambiguate
197-
from nested brackets.
197+
from nested brackets. You can embed these comments in expressions, as long as you don't insert them in the middle of keywords or identifiers.
198198
199199
=head3 Pod comments
200200

xt/words.pws

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
FQN
12
LHS
3+
NewType
24
Procs
35
RHS
46
Worthington
@@ -255,6 +257,7 @@ deallocation
255257
declarator
256258
declarators
257259
decodable
260+
decont
258261
decontainerization
259262
decontainerize
260263
decrement
@@ -284,6 +287,7 @@ dev
284287
devel
285288
devnull
286289
devs
290+
dex
287291
diag
288292
diffy
289293
dirhandle
@@ -664,6 +668,7 @@ mixins
664668
mixy
665669
mjd
666670
mkdir
671+
mmk
667672
moar
668673
moarvm
669674
moarvm's
@@ -767,6 +772,7 @@ nsw
767772
nswap
768773
nul
769774
num
775+
numified
770776
numify
771777
nums
772778
numstr
@@ -811,6 +817,7 @@ outliers
811817
outofrange
812818
ov
813819
overridable
820+
oðin
814821
pairup
815822
parallelize
816823
param
@@ -1373,9 +1380,3 @@ yyyy
13731380
zef
13741381
zoffixznet
13751382
zwj
1376-
mmk
1377-
FQN
1378-
NewType
1379-
dex
1380-
oðin
1381-
numified

0 commit comments

Comments
 (0)