On Tue, 26 May 2009, Daniel Carrera wrote:

Carl Mäsak wrote:
In this way, a relatively simple change makes Perl 6 Pod able to do literate
programing for anyone who is interested.

What do you think?

That it sounds like a good idea for a sublanguage-extending module.

I'm not familiar with those. Are they hard to make? I guess that it is perfectly reasonable to make this a separate module. How would it work?

They may not be possible as the code currently stands, but according to the spec, they'll be relatively easy once you have a grip on grammars.

A grammar groups regexes in the same way a class groups methods. Perl 6 itself is a grammar. So you have 3 steps:
1.      Make your own grammar that inherits from the Perl 6 one
2.      Override the rules that need changing
3.      Replace the Perl 6 grammar with your own.

Steps 1 and 3 are dead easy. Step 2 varies in difficulty depending on the changes you're making.

Step 1 is something like this:

grammar MyPerl6 is STD {
        ...
}

Step 3 will be something like this, I think:

$~MAIN = MyPerl6;


        See the section on "Grammars" in S05.

        http://perlcabal.org/syn/S05.html

        HTH,


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to