> "KF" == Ken Fox <[EMAIL PROTECTED]> writes:
KF> Simon Cozens wrote:
>> [EMAIL PROTECTED] (Damian Conway) writes:
>>
%hash4 = ("Something", "mixing", pairs => and, "scalars");
>>>
>>> That's perfectly okay (except you forgot the quotes around the
>>> and you have an odd
Damian Conway wrote:
> No. It will be equivalent to:
>
> <[\x0a\x0d...]>
I don't think \n can be a character class because it
is a two character sequence on some systems. Apoc 5
said \n will be the same everywhere, so won't it be
something like
rule \n { \x0d \x0a | \x0d | \x0a }
Hmm.
Simon Cozens wrote:
> [EMAIL PROTECTED] (Damian Conway) writes:
>
>>> %hash4 = ("Something", "mixing", pairs => and, "scalars");
>>
>>That's perfectly okay (except you forgot the quotes around the
>>and you have an odd number of elements initializing the hash).
>
> Urgh, no. Either a pair is a
On Sat, 2002-08-31 at 07:07, Damian Conway wrote:
> Aaron Sherman wrote:
>
> > Is C<\n> going to be a rule (e.g. C<< >>)
>
> There might be an named rule like that. But C<\n> will certainly
> still be available.
>
> > or is it implicitly translated to:
> >
> > <[\x0a\x0d...]>+
>
> No. It
> > $roundor7 = rx /<+[17]>/
> > That is: the union of the two character classes.
>
> Thank you; that wasn't in A5, E5 or S5. Will there be <-> as
> well?
>From A5:
The outer <...> also naturally serves as a container
for any extra syntax we decide to come up with for
charac
On Saturday, August 31, 2002, at 06:52 AM, Damian Conway wrote:
> my Date $date = Date.new('June 25, 2002');
>
>> my Date $date is now { .init 'June 25, 2002' };
>
> As is that.
Yes, but this:
my Really::Long::Package::Name::Ugh $date is now {.init 'June 25,
2002' };
Is shorter
[EMAIL PROTECTED] (Damian Conway) writes:
> Neither. You need:
> $roundor7 = rx /<+[17]>/
> That is: the union of the two character classes.
Thank you; that wasn't in A5, E5 or S5. Will there be <-> as
well?
--
I wish my keyboard had a SMITE key
-- J-P Stacey
[EMAIL PROTECTED] (Damian Conway) writes:
> > %hash4 = ("Something", "mixing", pairs => and, "scalars");
>
> That's perfectly okay (except you forgot the quotes around the
> and you have an odd number of elements initializing the hash).
Urgh, no. Either a pair is an atomic entity or it isn't.
Larry wrote:
> :my $date = Date.new('June 25, 2002');
>
> Assignment is wrong for conferring compile-time properties, I think.
Agreed. For a start, it's too late. The declaration is compile-time;
the assignment, run-time.
> We almost need some kind of topicalization:
>
> my Date $d
Aaron Sherman wrote:
> Is C<\n> going to be a rule (e.g. C<< >>)
There might be an named rule like that. But C<\n> will certainly
still be available.
> or is it implicitly translated to:
>
> <[\x0a\x0d...]>+
No. It will be equivalent to:
<[\x0a\x0d...]>
(no repetition)
> Al
Piers Cawley wrote:
> If I replace C<< ($key, $val) >> with
>
> @ary = m/<$pattern>/
>
> and the match succeeds, how many elements are there in @ary?
Zero. No explicit captures in that pattern.
> Suppose you want to use a hypothetical variable to bind a name to
> a capture
Trey Harris wrote:
>> sub repeat is multi ($desc is valued(1), &body) {
>> body(1);
>> }
>>
>> sub repeat is multi ($desc is valued(0), &body) {
>> }
>>
>> sub repeat is multi ($desc is valued(['A'..'F']), &body) {
>> die "Can't repeat hexadecimally";
Nicholas Clark asked:
>%hash3 = @kv_array
>
> Is perl6 going to spot that @kv_array has an even number of entries, all
> are scalars (no pairs), and so do this
>
>for @kv_array -> key, value {
>%hash3{$key} = $value;
>}
Yes. Just like in Perl 5.
> Or is it going to treat
HellyerP wrote:
> This week I was fortunate enough to hear Damian speak twice, once on
> everything and once on Perl6. Damian, it was tremendous of you to come
> and speak to us in London - thank-you very much.
It was my pleasure.
> If he's coming to a city near you, book
> your seats now.
From: "Nicholas Clark" <[EMAIL PROTECTED]>
> In Damian's excellent perl6 talk, I think he said that by default a hash
> in list context will return a list of pairs. Hence this
>
>@array = %hash
>
> for %hash with n keys would give an array of n elements, all pairs.
Will there actually be a
Piers Cawley wrote:
> Unless I'm very much mistaken, the order of execution will
> look like:
>
> $2:=$1; $1:=$2;
You're not binding $2:=$1. You're binding $2 to the first
capture. By default $1 is also bound to the first capture.
Assuming that numbered variables aren't special, the orde
On 31 Aug 2002 at 10:26, Piers Cawley wrote:
> > my $pattern = rx:w / $1:=(\S+) = $2:=(\S+) |
> > $2:=(\S+) = $1:=(\S+) /;
>
> Count the capturing groups. Looks like there's 4 of 'em to me. $1, $2,
> $3 and $4 are automatic variables which, according to the Apocalyp
On 31 Aug 2002 at 0:17, Piers Cawley wrote:
> my $pattern = rx:w / $1:=(\S+) = $2:=(\S+) |
> $2:=(\S+) = $1:=(\S+) /;
>
> @ary = m/<$pattern>/
>
> how many elements are there in @ary? I can
> make a case for 4 quite happily. Certainly that's what A5 seems to
18 matches
Mail list logo