Larry,

On Aug 9, 2005, at 7:19 PM, Larry Wall wrote:
: >So far, this is what I have picked up; some/most of it is probably
: >wrong:
: >
: >~ Foo ~
: >Is a type that variables etc. can be declared to have
:
: That is one way to look at it I suppose. The reality is that there will
: be no actual 'Foo', at least not in the metamodel. 'Foo' is a magical
: interpreter concept, which is really just an
: alias/pointer/level-of-indirection/whatever for class(Foo).

Well, Perl 6 The Language sees "Foo" as package(Foo), actually.

IIRC, autrijus said that one of the base concepts in PIL was a namespace (which is roughly equivalent to a package). So I have assumed in my metamodel (and mostly in recent refactorings) that the magic behind "Foo" would have something to do with packages/namespaces. So this aligns nicely with your view.

: >Is not an object
:
: Nope... its magic :)

Well, hmm, except insofar as any package is an object that knows how
to be a symbol table, and and be the base class for other kinds of more
magical packages.  The magic comes into play when these various package
objects start pretending to be modules or classes or roles or subtypes.

Let me make sure I understand this.

Package is an Object.
Module is a Package.
Class is a Package.
Role is a Package.

(I wont even go near subtypes as I dont completely understand them).

But is Perl6::Class (the Class class) also a Package? Or is "Foo" the Package in this picture?

If "Foo" is the Package, then it would then be possible to implement this system on-top of the metamodel?

If Perl6::Class is also a package, then we have a potential bootstrap issue.

: >  => I'm really not sure about this...
:
: ahh, but you were correct. Trust your instincts Stuart < the force is
: strong with this one I think >

Yes, you're basically correct.  It's just that Perl 6 The Language
thinks that all types are "interfaces" and thus stored in various
kinds of packages, many of which have public names, though there
are also anonymous and lexical packages/modules/classes/roles/types.

: >~ class(Foo) ~
: >Used as the invocant of class methods
:
: Yes. It is also the connection between the concrete instance and
: concrete metaclass instance.
:
: >  => Any other purpose?
:
: In autrijus's version of the model it also stores the index of the
: attribute in the instance storage array. But other than that, no it has
: no other purpose in my eyes.

From the viewpoint of Perl 6 The Language, a class also serves as the
generic placeholder for reasoning about objects of the class in the
abstract without necessarily actually having an object of that type
to play with.  As such it's the logical invocant for constructors, as
well as other methods that want to play "what if" games on the objects
of the class without necessarily creating one.  Some of these abstract
games will naturally call into the guts of the metaclass for answers.
For example, you might ask the class an abstract question: "If I were
to ask each existing object whether it thinks it's a member of your
class, how many would say 'yes'?"  Of course, the efficient way to
answer that question is probably not to interrogate all the objects,
but just cheat somehow via the metaobject.

I see all these "methods of interrogation" as being class methods defined in the base Object. Would that be correct?

I kinda like Autrijus's idea that "meta" just means "guts".  In
classical Greek, "meta" just means "with".  The fancy philosophical
meaning of "aboutness" isn't there, but is a backformation from
terms such as metaphysics.  Metaphysics is just what you study along
"with" physics.
Though "guts" objects is a bit offputting.  You know, I keep mistyping
"meta" as "meat" half the time, so maybe we should make that a feature
and call them "meat" objects instead. :-)

Except that then I'd be typing "meat" as "meta" half the time...

GutClass is kinda gross. I personally like the metaphors in "The Art of MOP", which are backstage objects/classes and on-stage objects/classes. The only thing that seperates them is the curtain, and even that can be pulled away to expose more, but is always in control of the backstage "crew" (aka the language implementors).


: >Is an object; instance of the 'Class' class
:
: Perl6::Class in the p5 metamodel. I also find adding either the Perl6::
: or just :: at the front of names like 'Class' are helpful.
:
: > => How do we get properly-typed access to members that class(Foo) has
: >     that aren't declared in 'Class'?
:
: class(Foo) instance methods will be for 'Foo', and the class methods
: will be for ::Class.
:
: The current metamodel hacks this in a kind of ugly way, but that is how
: I am seeing it.

I'm not sure if Class is really a class or just a role containing
the interface to bootstrap a class instance using the meatclass, er,
I mean, the metaclass.  The abstract parts of a class that overlie
the package are rather, um, abstract.

Larry


Reply via email to