Ingo,

On Jul 11, 2005, at 3:14 PM, Ingo Blechschmidt wrote:
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?

Probably not, it is more likely that I am wrong :)

However, this does bring up the point of how one can access the class(Foo), meaning the instance of "Class" which represents Foo.

I for one think whatever it is it should involve a colon :P

Stevan



--Ingo

--
Linux, the choice of a GNU | Black holes result when God divides the
generation on a dual AMD   | universe by zero.
Athlon!                    |



Reply via email to