develooper Front page | perl.perl6.language | Postings from July 2005

Re: User-defined infix subs/methods?

Thread Previous | Thread Next
From:
Michele Dondi
Date:
July 14, 2005 02:08
Subject:
Re: User-defined infix subs/methods?
Message ID:
Pine.LNX.4.62.0507141040490.17732@stout.pcteor1.mi.infn.it
On Wed, 13 Jul 2005, Ingo Blechschmidt wrote:

> no, if I understood Larry correctly, you can of course write a nice
> grammar-modifying module, but other modules you use() still use
> Perl 6's standard grammar. E.g.:

Ah, then of course I would have never expected things to be different at 
all.

> If you wanted the compiler to parse SomeOtherModule.pm using Ruby's
> grammar, you'd have to write:
>
>    use Grammar::Ruby;
>    reuse SomeOtherModule

So that, after all, I don't think it would be much used since if 
SomeOtherModule was thought to be parsed according to Grammar::Ruby, it 
would take care of using it in the first place, I guess.

Unless, of course, SomeOtherModule could be parsed correctly -and 
hopefully behave differently- under two or more different grammars, in 
which case it would be funny to see the effects of, say,

use Grammar::Ruby;
reuse SomeOtherModule;
use Grammar::hq9plus;
reuse SomeOtherModule;
# ...

which reminds me of good'ol' "GEB"...


Michele
-- 
Never attribute to malice that which
can be adequately explained by stupidity
- "Hanlon's Razor"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About