On Mon, Jan 12, 2009 at 03:38:04AM -0800, Jon Lang wrote:
: Ovid wrote:
: > Is it possible to modify the core Perl6Array class like that (without extra
keywords)? If so, is it possible for each programmer to make such a change so
that it's lexically scoped?
:
: AFAIK, it is not possible to modify a core class;
Well, you can always say
class Array is also { ... }
Classes are open by default and may only be closed by the
application-level optimizer, if no one requests the class remain
open permanently. However, we do not glorify monkeytyping to the
extent that, say, Ruby culture does.
As for Perl6Array, that's a rakudo type, not a Perl 6 type, so I
can't speak for it. I'd just as soon that the name not show up in
Perl 6's namespace, if I had my druthers.
: however, I believe
: that it _is_ possible to derive a new class whose "name" differs from
: an existing class only in terms of version information, such that it
: is substituted for the original class within the lexical scope where
: it was defined, barring explicit inclusion of version information when
: the class is referenced.
That is the preferred way to avoid action-at-a-distance in P6.
Larry