----- Original Message -----
From: "Damian Conway" <[EMAIL PROTECTED]>
To: "Perl6" <[EMAIL PROTECTED]>
Sent: Tuesday, March 11, 2003 9:35 PM
Subject: Re: A6: overloading multis on constness of parameters


> Joe Gottman wrote:
>
> >    Will it be possible in perl6 to overload multis on the const-ness of
a
> > parameter, like C++ does?  For instance,
> >
> >    multi getX(Foo $self:) returns Int {...} #const version
> >    multi getX(Foo $self: is rw) returns Int is rw {...} #non-const
version
>
> That second one would have to be:
>
>       multi getX(Foo $self is rw:) returns Int is rw {...}
>
>
> Then we have the issue that Perl 6 objects can't really be "constant",
> since C<is constant> is a compile-time trait of *containers*...really just
> a "don't assign to this container" marker.
>
> However, within those limitations, I guess it's possible. After all, we
have
> to check for lvaluability of C<is rw> parameters anyway.

   How would I take a get a reference to the second one?  I assume I could
get a reference to the first by

   $ref = &getX(Foo);

Joe Gottman


Reply via email to