Looking at the source for Int , I see that all classes are declared using my , so I would think they are closed and inaccessible outside this file. But obviously they are. Why should they be declared this way?
my class Rat { ... } my class X::Numeric::DivideByZero { ... } my class X::NYI::BigInt { ... } my class Int { ... } my subset UInt of Int where {not .defined or $_ >= 0}; my class Int does Real { # declared in BOOTSTRAP
I believe the BOOTSTRAP comment is relevant. Perl6 / Metamodel / BOOTSTRAP.nqp has lines such as:
my stub Int metaclass Perl6::Metamodel::ClassHOW { ... };
perl6 lexical-scope
brian d foy
source share