"Stephen P. Potter" <[EMAIL PROTECTED]> writes:

> Lightning flashed, thunder crashed and Tom Christiansen <[EMAIL PROTECTED]
> m> whispered:
> | >The // tend to confuse people and make them expect tr to operate as a
> | >regular expression.
> | 
> | So what?  q/.../ is not a "regex function" either.   These are all 
> | pick-you-own-quotes function.  This makes no sense.
> 
> Personally, I would say that q/.../ and friends were a bad idea. 

I'll just add a vote to say that they are a bloody *good* idea.

> A lot of non-gurus see /.../ (whatever comes before it) and their
> first impression is that it has something to do with regex. 

Well, the way it works is analogous to the way you can do m#foo# so it
kinda has something to do with regexen. Just not the same something.

> I would suggest that anything that isn't a regex should not use
> /.../. 

There's *possibly* a case for using something other than / in the
default docs where they are discussed, but it's very tenuous. I think
of /.../ as being vaguely quotelike and they get used as that in
various places. The most common being pattern matching so, in the case
of a pattern match, you get to drop the leading 'm'. 

> Make q, qq, etc use matched pairs. Make tr look like a regular
> function and do tr(SEARCH, REPLACE, MOD, STR). It just seems more
> orthagonal to me.

Maybe orthogonality is in the eye of the beholder. Maybe it's not that
desireable anyway. Isn't 'orthogonality' just another word for
"There's only one way to do it"?

-- 
Piers


Reply via email to