Front page | perl.perl6.language |
Postings from July 2002
Re: what's new continued
Thread Previous
|
Thread Next
From:
Ashley Winters
Date:
July 3, 2002 21:08
Subject:
Re: what's new continued
Message ID:
200207032107.39608.qaqortog@nwlink.com
On Wednesday 03 July 2002 06:39 pm, Larry Wall wrote:
> On Wed, 3 Jul 2002, Damian Conway wrote:
> : Date: Wed, 03 Jul 2002 19:33:33 -0400
> : From: Damian Conway <damian@conway.org>
> : To: "perl6-language@perl.org" <perl6-language@perl.org>
> : Subject: Re: what's new continued
> :
> : Comments (otherwise you have things pretty much right):
>
> I didn't see the original here.
>
> : > we can even have hyper-assignment :
> : >
> : > my ($a, $b) ^= new Foo;
> :
> : This is unlikely to do what you wanted. It creates a new Foo object and
> : then assigns a reference to that one object to both $a and $b. It doesn't
> : create two Foo objects. (But maybe one object referenced twice is what
> : you wanted).
>
> It *might* possibly work to hyper the constructor:
>
> my ($a, $b) = ^new Foo
Would prefix ^ always return 'wanted' number of repetitions? Like a smart
C<x Inf>?
@x = qw(foo bar baz); @y = (one);
for @x, ^"unseen"; @y, ^"too high" -> $x; $y {
# foo, one
# bar, too high
# baz, too high
}
Ashley Winters
Thread Previous
|
Thread Next