@@ -249,7 +249,7 @@ characters with the Unicode General Category value I<Letter> (L), and the
249
249
underscore C < _ > . Alphanumeric characters additionally include characters with
250
250
the Unicode General Category value I < Number, Decimal Digit > (Nd).
251
251
252
- = begin code :skip-test
252
+ = begin code
253
253
# valid ordinary identifiers:
254
254
x
255
255
_snake_oil
@@ -260,12 +260,12 @@ piece_of_π
260
260
駱駝道 # "Rakuda-dō", Japanese for "Way of the camel"
261
261
= end code
262
262
263
- = begin code :skip-test
263
+ = begin code
264
264
# invalid ordinary identifiers:
265
- 42 # Identifier does not start with alphabetic character
266
- with-numbers1234-5 # Embedded hyphen not followed by alphabetic character
267
- is-prime? # Question mark is not alphanumeric
268
- x² # Superscript 2 is not alphanumeric (in the sense explained above)
265
+ 42 # identifier does not start with alphabetic character
266
+ with-numbers1234-5 # embedded hyphen not followed by alphabetic character
267
+ is-prime? # question mark is not alphanumeric
268
+ x² # superscript 2 is not alphanumeric (in the sense explained above)
269
269
= end code
270
270
271
271
= head3 Extended identifiers
@@ -276,8 +276,8 @@ a common "short" name, but still needs for each of its elements to be identifiab
276
276
individually. For example, you might use a module whose short name is C < Dog > , while
277
277
its long name includes its naming authority and version:
278
278
279
- = begin code :skip-test
280
- Dog:auth<Somebody>:ver<1.0> # Long module names including author and version
279
+ = begin code
280
+ Dog:auth<Somebody>:ver<1.0> # long module names including author and version
281
281
Dog:auth<Somebody>:ver<2.0>
282
282
283
283
------------------------------------
@@ -292,7 +292,7 @@ Similarly, sets of operators work together in various syntactic categories with
292
292
like C < prefix > , C < infix > , C < postfix > , etc. The long, official names of these operators
293
293
often contain characters that are excluded from ordinary identifiers:
294
294
295
- = begin code :skip-test
295
+ = begin code
296
296
infix:<+> # the official name of the operator in $a + $b
297
297
infix:<*> # the official name of the operator in $a * $b
298
298
infix:«<=» # the official name of the operator in $a <= $b
@@ -308,7 +308,7 @@ followed by an ordinary identifier C<key> and/or a quoting bracketing construct
308
308
such as C « < > » , C < « » > or C < [' '] > which quotes one or more arbitrary characters
309
309
C < value > :
310
310
311
- = begin code :skip-test
311
+ = begin code
312
312
# exemplary valid extended identifiers:
313
313
postfix:<²> # the official long name of the operator in $x²
314
314
WOW:That'sAwesome
@@ -329,7 +329,7 @@ so C<infix:<+>> and C<infix:<->> are two different operators. The bracketing
329
329
characters used, however, do not count as part of the name; only the quoted data
330
330
matters. So these are all the same name:
331
331
332
- = begin code :skip-test
332
+ = begin code
333
333
infix:<+>
334
334
infix:<<+>>
335
335
infix:«+»
@@ -339,7 +339,7 @@ matters. So these are all the same name:
339
339
340
340
Similarly, all of this works:
341
341
342
- = begin code :skip-test
342
+ = begin code
343
343
my $foo:bar<baz> = 'quux';
344
344
say $foo:bar«baz»; # OUTPUT: «quux»
345
345
my $take-me:<home> = 'When the glory has no end';
@@ -351,7 +351,7 @@ Similarly, all of this works:
351
351
Where an extended identifier comprises two or more colon pairs, their order
352
352
is generally significant:
353
353
354
- = begin code :skip-test
354
+ = begin code
355
355
my $a:b<c>:d<e> = 100;
356
356
my $a:d<e>:b<c> = 200;
357
357
say $a:b<c>:d<e>; # OUTPUT: «100», NOT: «200»
@@ -360,16 +360,16 @@ is generally significant:
360
360
An exception to this rule is I < module versioning > ; so these identifiers
361
361
effectively name the same module:
362
362
363
- = begin code :skip-test
363
+ = begin code
364
364
use ThatModule:auth<Somebody>:ver<2.7.18.28.18>
365
365
use ThatModule:ver<2.7.18.28.18>:auth<Somebody>
366
366
= end code
367
367
368
- Furthermore, the adverbial form in extended identifiers supports
369
- compile-time interpolation, which mandates the use of
368
+ Furthermore, colon pairs in extended identifiers support
369
+ compile-time interpolation; this requires the use of
370
370
L < constants|/language/terms#Constants > for the interpolation values:
371
371
372
- = begin code :skip-test
372
+ = begin code
373
373
constant $c = 42; # Constant binds to Int; $-sigil enables interpolation
374
374
my $a:foo<42> = "answer";
375
375
say $a:foo«$c»; # OUTPUT: «answer»
@@ -381,7 +381,7 @@ angle brackets C«< >» (which mimic single quote interpolation
381
381
characteristics) cannot be used for the interpolation of constant
382
382
names.
383
383
384
- = begin code :skip-test
384
+ = begin code
385
385
constant $what = 'are';
386
386
my @we:<are>= <the champions>;
387
387
say @we:«$what»; # OUTPUT: «[the champions]»
0 commit comments