Running the following simple code, checking the behaviour of sigilless variables, produces a strange error:
use v6.d; # Rakudo Star 2020.05.01 (Windows)
sub test ($p) {
say $p;
}
my \v1 = 1;
say v1; # v1 (ERROR)
test(v1); # v1 (ERROR)
my \v = 1;
say v; # 1 (Correct)
test(v); # 1 (Correct)
my \vv1 = 1;
say vv1; # 1 (Correct)
test(vv1); # 1 (Correct)
my \s1 = 1;
say s1; # 1 (Correct)
test(s1); # 1 (Correct)
Why is that?
Literals that start with v
and are followed by a number (and dots and then other numbers) are considered versions. That means that you can't use anything starting with v and followed by numbers as sigilless identifier.
say (v1.2.3).parts; # OUTPUT: «(1 2 3)»
That's probably underdocumented, though...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With