>>>>> "RM" == Rich Morin <[EMAIL PROTECTED]> writes:

  RM> On occasion, I have found it useful to cobble up a "little language"
  RM> that allows me to generate a list of items, using a wild-card or some
  RM> other syntax, as:

  RM>    foo[0-9][0-9]  yields foo00, foo01, ...

  RM> I'm wondering whether Perl should have a similar capability, using REs.

the problem is that regexes can be very wide in accepting data but your
needs are narrow. how do you expand . or .*  ?

what you want is more like a macro facility. my favorite macro support
came with macro-11. it had .IRPC (indefinite repeat char) so you could
do this (untested and surely bad syntax :)

        .IRPC   $A, 0123456789
        .IRPC   $B, 0123456789
        .ASCII  'foo$A$B'
        .END
        .END

there has been debate here about what level of macro support to have. we
can't do lisp's as we don't have easy access to generated code and we
have to be better than cpp which is useless IMO as you don't have nested
calls and loops.

but for stuff like table and data structure building we should have some
way to generate perl source/data with decent control.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to