On Sun, Apr 25, 2004 at 08:16:30PM -0700, Dave Whipp wrote:
> Abhijit A. Mahabal wrote:
> 
> >>> *{"Foo::name1"} = -> $a { $a->{name1} };
> >>
> >>If I read A12 correctly, this could be written as:
> >>
> >> &Foo::$name1 := -> $a {$a.name1};
> >>
> >
> >
> >Could be; that sounds somewhat right, but could you point out where in A12
> >because a search for := revelaed nothing relevant to me.
> >
> 
> Sorry, the assignment part came from A6 (and, rechecking, it seems to 
> use ::= when assigning to a sub). 

It all depends on what you mean.  := is run-time aliasing, ::= is
compile-time aliasing. So, if it really were &Foo::name1, then ::=
would be fine, but if it were &Foo::$name then it probably needs to be
:=  (I'd guess that if perl knew what $name was by the time that it
got to compiling &Foo::$name, then ::= would work just fine)

> The ability to say pkg::$name came from A12.

I'm fairly sure that you have to parenthesize interpolated things, so
all of those above should look like this:

        &Foo::($name) := -> $a { $a.name1 };

See http://dev.perl.org/perl6/apocalypse/A12.html#Class_Name_Semantics
(Or was there someplace that said simple scalars need not be
parenthesized?)

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to