On Sun, 26 Dec 2004 18:59:13 +0000, Alberto Manuel Brandao Simoes <[EMAIL PROTECTED]> wrote: > Xavier Noria wrote: > > On Dec 26, 2004, at 7:07 PM, Alberto Manuel Brandao Simoes wrote: > > > >> THe idea: > >> > >> RULES foo > >> aa==>bb > >> cd==>ef > >> ENDRULES > >> > >> and it creates the function foo which receives a string, and applies > >> the rules while possible, rewritting the string. > > > > > > Then, the purpose of the module is to construct and export that > > subroutine so that clients can apply it to their own strings? Or is it a > > source filter that rewrites the code according to a set of such rules > > passed as parameter? > > The first :) > > > > -- fxn
I don't get why this makes more sense as a source filter then as a module that does all the rules-into-routines operation in its export function. The given examples would then look like use ReWriteRoutines foo => <<'ENDRULESfoo', aa==>bb cd==>ef ENDRULESfoo bar => a(b+)c==>c$1a!!length($1)>5'; to create foo($) and bar($) in the using package, and it doesn't have to be a source filter. my coroutine0 module provides an example of a module that rewrites a string into coderef, for what that's worth. -- David L Nicol You're striving for harmony, and, if you try to take too much, you'll come to grief. -- Michael Redmond