----- Original Message -----
From: Luke Palmer <[EMAIL PROTECTED]>
Date: Saturday, December 18, 2004 4:16 pm
Subject: Re: Auto My?

> Rod Adams writes:
> There are pros and cons, and it basically ends up being a design 
> choice.
> > Well, at least when strictures are on. When they are off, the 
> coder is 
> > obviously playing fast and loose, and should get the easy 
> 'everything 
> > global' behavior.
> 
> When strictures are on, the compiler ought to die if you're tyring to
> use a variable without declaration.  This is another reason why Perl
> doesn't like autodeclaration.

As bad of an idea that I think this is, I wonder if 
Perl6's reflection capabilities will be powerful 
enough to where a module/pragma could be written 
that would be able to do this?  For instance, one 
idea was: lexically change the current grammar to a 
subclass of the grammar.  In this subclass, there is
a hook on the "variable" deparsing rule that will 
implictly declare a variable into its outer scope if
it has not yet been declared in the current scope.  
Totally whacky, sure; but doable?

That brings up another idea that I had just now: 
will it be possible to load 2 different grammars at
once if they don't conflict with each other?  For 
instance, say we have loaded a grammer, 
Grammar::WhackyVars, that subclasses from the main 
Perl6 grammar but modifies the "variable" rule 
somehow.  However, then say I want to use a grammar
that also subclasses from the main Perl6 grammar 
that lets you use "happyfunactiontime" instead of 
the word "class".  Since the modified rules don't 
conflict with each other, can I just "use 
Grammar::HappyFunActionTime" and everything will 
work?  Or will Grammar::HappyFunActionTime overload
the changes done by the Grammar::WhackyVars?

- Joe

Reply via email to