I was going to submit this as a Rakudo bug report, but I'm not sure
it's (a natural consequence of) spec, so I'll ask here on p6l instead.
I already know I can do all of the following:
$a[42];
$a.postcircumfix:<[ ]>(42);
$a = $a.postcircumfix:<[ ]>(42);
$a.=postcircumfix:<[ ]>(42);
But can I
How is "character counting" done in Perl 6?
In Perl 5, it is `scalar tr/CG//` if I want to count the number of Cs
plus the number of Gs in a string.
S05 describes tr/// in terms of the .trans function, a handsome but
very different beast. Specifically, it doesn't seem to have a "scalar
context",
What does trans return in numeric (+) context?
On Wednesday, January 27, 2010, Carl Mäsak wrote:
> How is "character counting" done in Perl 6?
>
> In Perl 5, it is `scalar tr/CG//` if I want to count the number of Cs
> plus the number of Gs in a string.
>
> S05 describes tr/// in terms of the .tr
Mark (>), Carl (>>):
>> S05 describes tr/// in terms of the .trans function, a handsome but
>> very different beast. Specifically, it doesn't seem to have a "scalar
>> context", with which one could count things.
>
> What does trans return in numeric (+) context?
As spec'd, it returns the numifica
On Wed, Jan 27, 2010 at 1:19 PM, Carl Mäsak wrote:
> Mark (>), Carl (>>):
>>> S05 describes tr/// in terms of the .trans function, a handsome but
>>> very different beast. Specifically, it doesn't seem to have a "scalar
>>> context", with which one could count things.
>>
>> What does trans return
Hm, lost p6l along the way. Forwarding.
-- Forwarded message --
From: Carl Mäsak
Date: Wed, Jan 27, 2010 at 2:31 PM
Subject: Re: Counting characters
To: Moritz Lenz
Moritz (>), Carl (>>):
>> How is "character counting" done in Perl 6?
>>
>> In Perl 5, it is `scalar tr/CG//` if
On Wed, Jan 27, 2010 at 01:24:48PM +, Matthew Walton wrote:
: On Wed, Jan 27, 2010 at 1:19 PM, Carl Mäsak wrote:
: > Mark (>), Carl (>>):
: >>> S05 describes tr/// in terms of the .trans function, a handsome but
: >>> very different beast. Specifically, it doesn't seem to have a "scalar
: >>>