On Sat, Apr 16, 2005 at 02:42:25AM -0700, Ashley Winters wrote:
: I never liked character sets. They introduced yet another exception to
: the parsing rules, and it irked me. If it weren't for the need to
: optimize character sets, I'd prefer to be Pythonized into using @{'a'
: .. 'z'}
: 
: If I read the Apocalypses correctly, I'm allowed to use this bizzare 
construct:
: 
: $foo ~~ /@{< [ ] { } < > : ++ $ . ? / +| +& ?| ?& >}/
: 
: to match some of my favorite punctuations, right?

Not unless you backwhack that internal > there.

: It allows
: multi-character alternatives as well as the single-character ones, so
: it seems preferable to me (assuming it could be optimized happily).

I will happily assume that all sorts of things could be optimized away
if only someone will generate an endless supply of convex tuits.

Assuming someone doesn't invent such a tuit factory, and that the @ matcher
is smart about caching unchanged arrays, you might actually get much better
performance out of:

    @myfavoritepunctuations = < [ ] { } < \> : ++ $ . ? / +| +& ?| ?& >;
    $foo ~~ /@myfavoritepunctuations/;

It's arguably a lot more readable too.

Larry

Reply via email to