Hi,
Michele Dondi wrote:
>> Good, I'd forgotten about that. Which means that it's even harder
>> for someone to compile a module in a "strange" dialect, since they'd
>> essentially have to write their own version of "use" that forces
>> recompilation ("reuse", if you will). And the harder we make it to
>> write "reuse", the better.
>
> IIUC this will introduce a certain degree of asymmetry though, in that
> in some sense p6 will be extremely generous in giving users the
> ability to use whatever dialect/syntax modification they like in their
> programs but just at the same time it will try to make it hard for
> them to do so when refactoring code into suitable modules. Ain't it
> so?
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.:
use Grammar::Ruby;
# Ruby syntax from here on:
proc { |a| puts a + 1 }.call 3 # 4
use SomeOtherModule
# SomeOtherModule.pm will be parsed using the standard grammar,
# *not* Grammar::Ruby.
If you wanted the compiler to parse SomeOtherModule.pm using Ruby's
grammar, you'd have to write:
use Grammar::Ruby;
reuse SomeOtherModule
--Ingo
--
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD | stream...
Athlon! |