TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote:
HaloO,
John M. Dlugosz wrote:
They are mixed! Perl treats types as first-class objects. For
functions, types don't need to be treated specially from other
arguments as in C++.
Looks like we need a third party ruling on that. Note that the
HOW is the meta class object and the WHAT the prototype object.
None of these *are* types. This is just like the pope is not God
but he is the prime *object* that does Catholic. And of course
it is debatable if God does Catholic ;)
I think I see what you are getting at, but it was not really clear from
your reply.
Using Dog in an expression (rather than a declaration) returns an
undefined protoobject of type Dog. But we already know that this is
supposed to work:
my ::Alias ::= Dog;
but maybe the RHS of ::= (if not :=) has its own special parsing rules.
We want
my Dog $x;
my Type $t;
$x = Dog;
$t = ::Dog;
to both work. Maybe
$t = Dog;
will work as well, by suitable supertypes and/or conversions of the type
of the protoobject.
Or maybe it's the other way around: Dog is of type Class, which has an
implicit coersion to Dog defined on it that returns the protoobject.
OUTER::C is lexical. But it sounds like the explanation you are
giving is the same.
But I find it conceptually clearer to bind a namespace ref
than calling a magic function. It sort of amounts to the same
outcome, though.
This makes more sense after reading your later message. You want
implicit generics, with the attendant specialization phase that provides
a point where these bindings can occur, rather than the virtual name
idea from the original Apocalypse.
Maybe Larry will wade in.
--John