Larry Wall wrote:
> : 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.

so if I do that, will a 'my @a' use that new Array class?

Actually I'd prefer it if there were some kind of mechanism to set a
default implementation type, so that I could write something along these
lines:

class MyArray is Array { ... }
use Container :Array<MyArray>;

then is this lexical scope all Array declarations and all Prelude
operations that return Arrays return one of the type that I specified.

Cheers,
Moritz

Reply via email to