[prev] [thread] [next] [lurker] [Date index for 2006/12/17]
* Peter da Silva <peter@xxxxxxx.xxx> [2006-12-17 03:15]: > On Dec 16, 2006, at 7:44 PM, A. Pagaltzis wrote: > >>I could go on, getting in to the sorts of hate that Perl > >>enables - s;foo;bar; anyone? > > >That's annoying, but do you find the following pretty? > > > s/^file:\/\/\/?// > > Neither is acceptable. > > It should be something like > > string.replace("^file:///?",""); > > Or maybe > > string replace: '^file:///?' with: ''. > > Or even > > (ask string replace '"^file:///?" nil) Whatever you think the substitution API should be (and I'm not a huge fan of Perl's), putting patterns into simple string literals is hateful. Firstly, you end up doubling every backslash. I *can* juggle layers of quoting in my head, better than most people I know actually, but that doesn't mean it's a favourite pastime of mine. Regular expressions are a language in their own right; they should at least have their own kind of literal. Even Perl 5 is not consistent enough in this regard. Secondly, quotes are so frequently part of a pattern that using them as delimiters for patterns is even worse than using forward slashes; backslashes galore. I generally use bangs. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>There's stuff above here
Generated at 22:02 on 27 Dec 2006 by mariachi 0.52