in reply to Re: enumeration, again...
in thread enumeration, again...

While that works in the simple case, I didn't want to add ugly delimiters when my input grows to be more complex than simple words.

Replies are listed 'Best First'.
Re^3: enumeration, again...
by merlyn (Sage) on Mar 28, 2005 at 18:01 UTC
    So? Do a mapping. map all your words to four-character short names (take the next item from 'aaaa'..'zzzz', thanks to ++ this is easy).

    Then do your glob with glob. Then map all results through a "find 4 characters and replace them with the mapping" operations. Like magic!

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.


    update: If you think about this, it's a bit like how I came up with what was later called "the Schwartzian transform". When you can't solve a problem in one space, map it to another space, do the solution, then map it back. It's a common pattern of mine for solving things.