On Wed, Mar 12, 2003 at 01:35:08PM +1100, Damian Conway wrote:
: 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.
Might be one of those things that is taken as a tie-breaker, all other
things being equal. I'm thinking return types fall into the same category.
Larry