Web weirdness

Abigail abigail at abigail.be
Thu Jul 5 00:51:59 BST 2007


On Wed, Jul 04, 2007 at 10:01:05PM +0100, Daniel Barlow wrote:
> Abigail wrote:
> >On Wed, Jun 20, 2007 at 01:34:32PM +0100, David Cantrell wrote:
> >>&image=... != ℑ
> 
> I just spent several seconds of my life trying to parse that in C.  Ouch
> 
> >And 
> >
> >  do {print "foo"}  !=  do {print "foo";}
> >
> >yet, semantically, they are identical. In Perl, the semi-colon terminating
> >the statement is optional if Perl can deduce from what follows where the
> >statement ends. Same in HTML.
> 
> I don't have a Perl grammar to hand (if indeed such a thing exists) and 
> it may well use some kind of evil heuristic to parse this, but I note 
> that you could achieve the same effect by specifying ';' as a statement 
> *separator* instead of a *terminator*.  Which I think is what Pascal does.

Perl as well. (Sort of. {print "foo";} is just one statement, not a print
statement followed by an empty one).

But the effect is the same.

> >The choice of & to separate CGI parameters (which in themselves are a
> >minilanguage inside URLs) was a pretty poor one considering the role of
> >& in HTML documents.
> 
> I suspect that the people who originally designed CGI were mostly 
> unaware of SGML.  (I have vague memories that early versions of HTML 
> were not SGML applications anyway, BICBW)
> 
> Nevertheless it was still a pretty dumb choice given its use in the unix 
> shell.  OK, ; is not much better from that perspective either


The problem with shells is that many characters are special - overlap
with URLs is almost impossible (unless you want to make letters special
inside URLs). Both '?' and '#' are not uncommon in URLs (and appear
in the specification of URLs, unlike the & which stems from the CGI
specification), and will screw you if you're using a shell and you
aren't quoting.

Beside ?, #, & and ;, the (http) URL specification allow the characters 
(, ), $, *, !, and '. Some schemes have < and > as allowable characters
as well.



Abigail



More information about the london.pm mailing list