On 6/3/05, Millsa Erlas <[EMAIL PROTECTED]> wrote:
> Does this allow the grammer rules of the language to be changed so that
> this could be implemented? How does this work?

Yes.  In fact, one of the big goals of perl 6 is to allow people to
mutate the grammar of the language.

If you just want scalar sigilless variables, you might do something like this:

    grammar Sigilless;
    is Perl::Grammar;
    rule sigil () { $<super> := <SUPER::sigil> 
                    { $<sigil> = $<super><sigi> } 
                  | <null> 
                    { $<sigil> = '$' }
    module sigilless;
    sub import () { 
        SHIFT { use grammar Sigilless }

(Where I use SHIFT, which I just learned about from Autrijus, to
execute code in the caller's scope.)

That seems the simplest hypothetical way.  I'm not sure how that would
play with the real grammar.  We can hope it's that simple, but it will
likely take a bit more work than that.

This pretends that all sigilless variables are scalars, which might be
the best way for sigilless to go anyway given Perl 6's reference


Reply via email to