Hi,
Stevan Little wrote:
> Actually I was thinking that MyClass.isa(...) would work much as it
> did in Perl 5 (like an instance). But that access to the underlying
> MyClass class instance would not be as simple. Something like
> ::MyClass would provide access to the Class instance.
>
> class Foo {}
> Foo.isa(Object) # true
> Foo.isa(Foo) # true
> Foo.isa(Class) # false
>
> ::Foo.isa(Object) # true
> ::Foo.isa(Class) # true
> ::Foo.isa(Foo) # false
>
> However, this is not speced anywhere, so I am just really making stuff
> up out of my head :)
I've always thought Foo and ::Foo were synonyms (except maybe in
signatures, but that's another thread). I.e.:
Foo =:= ::Foo =:= ::("Foo"); # true
And all of these are (except if you do metamodel hackery) Class objects,
i.e. the following all work and are semantically identical:
my $foo = Foo .new;
my $foo = ::Foo .new;
my $foo = ::("Foo").new;
Am I wrong?
--Ingo
--
Linux, the choice of a GNU | Black holes result when God divides the
generation on a dual AMD | universe by zero.
Athlon! |