(I'm just studying the intricacies of Perl 6, so please correct me if
i say something stupid or if this has already been discussed before.)
I was looking for the Perl 6 equivalent of
aaa =~ /a{1,3}/
and finally found that it's
aaa ~~ /a**{1 .. 3}/
This looked rather weird, so i asked on IRC
On 7/1/07, Amir E. Aharoni [EMAIL PROTECTED] wrote:
I got the reply that it is similar to exponentiation of variables in math:
a ** 5 == a * a * a * a * a == a
It makes sense after it is explained and i do like the rationalization
of the range as a list-like range, instead of the comma,
please correct me if
i say something stupid or if this has already been discussed before.)
Another important loss if we were to go with 1..3 would be the
ability to have runtime-dependent ranges; e.g.:
/ ($ntimes) x**{$ntimes} /
That's exactly what i meant by something stupid.
Thanks
On 7/1/07, Amir E. Aharoni [EMAIL PROTECTED] wrote:
On 01/07/07, Luke Palmer [EMAIL PROTECTED] wrote:
/ $ntimes := (\d+) x**{$ntimes} /
The examples of := usage in S05 seem to have notation such as this:
$ntimes := (\d+)
Yes, that is correct. I've been away from the Perl 6