Re: Invalid Operating System

[prev] [thread] [next] [lurker] [Date index for 2006/12/17]

From: Peter da Silva
Subject: Re: Invalid Operating System
Date: 14:16 on 17 Dec 2006
On Dec 16, 2006, at 10:20 PM, A. Pagaltzis wrote:
> 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.

There's no alternative. Either they're strings and can be manipulated 
as strings, or they're not.

> Firstly, you end up doubling every backslash.

Only if your string syntax is a blind copy of C string syntax, *and* 
your pattern syntax us a blind copy of sed regular expressions.

> Regular expressions are a language in their own right; they
> should at least have their own kind of literal.

I would express it as "regular expression literals and string literals 
should not conflict". There's no reason they should.

> 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.

Quote are frequently enough parts of strings for the same objection to 
be true even for strings, that's why (for example) Javascript allows 
either single or double quotes as delimiters for *all* strings.

There's stuff above here

Generated at 22:02 on 27 Dec 2006 by mariachi 0.52