At 1:05 PM -0400 4/22/04, Aaron Sherman wrote:
On Thu, 2004-04-22 at 11:22, Dan Sugalski wrote:
At 10:48 AM -0400 4/22/04, Aaron Sherman wrote:

 >More to the point, Perl 6's compiler will have to parse "class Joe",
 >create a new object of type Class, parse and execute the following
 >block/closure in class MetaClass, assign the result into the new Class
 >object named Joe and then continue parsing, needing access to the values
 >that were just created in order to further parse the declaration of $j

 Erm... no. Not even close, really. There's really nothing at all
 special about this--it's a very standard user-defined type issue,
 dead-common compiler stuff. You could, if you wanted, really
 complicate it, but there's no reason to and unless someone really
 messes up we're not going to. Just no need.

That's not at all what A12 said. And, I quote:


        One of the big advances in Perl 5 was that a program could be in
        charge of its own compilation via use statements and BEGIN
        blocks. A Perl program isn't a passive thing that a compiler has
        its way with, willy-nilly. It's an active thing that negotiates
        with the compiler for a set of semantics. In Perl 6 we're not
        shying away from that, but taking it further, and at the same
        time hiding it in a more declarative style. So you need to be
        aware that, although many of the things we'll be talking about
        here look like declarations, they trigger Perl code that runs
        during compilation.

This is in direct contradiction to what I'm hearing from you, Dan.
What's the scoop?

The scoop is that


my Joe $foo;

emits the code that, at runtime, finds the class ID of whatever Joe's in scope, instantiates a new object of that class, and sticks it into the $foo lexical slot that's in scope at runtime. It's possible you could redefine the grammar to have it do something different, in which case I suppose the answer's "whatever you've convinced the compiler to do" but in that case the question's essentially meaningless, since you could, if you wanted, define it such that invoking the perl 6 grammar reformatted your hard drives or something.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to