[plt-scheme] Problem fetching a URL

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Oct 11 18:07:07 EDT 2006

On Oct 11, Robby Findler wrote:
> At Wed, 11 Oct 2006 17:38:45 -0400, Eli Barzilay wrote:
> > On Oct 11, Robby Findler wrote:
> > > 
> > > The url is actually parsed and unparsed in the code you sent and,
> > > the way that library is currently designed, the delimiter isn't
> > > recorded in the parsed form.
> > > 
> > > Perhaps it should be, but it seems hard to be sure.
> > 
> > Maybe this will make sense?  -- Add another slot to the url struct
> > that holds the default separator.  Make this slot be #f by default
> > which will mean "consult the parameter value".  Then, the code that
> > parses urls can try to do so using "[&;]" as a pattern and:
> > * If neither appears, leave the slot #f
> > * If all occurrences are the same, use it for the slot value
> > * Otherwise throw an error
> > 
> > This will make most string-specified url problems go away, and it
> > will also be better than a global parameter that can be a problem
> > with code that interfaces two servers with different separators.
> 
> I was thinking of something like that, but changing the default
> value of that parameter to something that has the semantics
> `get-the-value-from-the-url-struct-or-use-semi-colon' but I'm not
> sure of the wisdom of that. Seems like we run into this problem
> enough that its worth at least trying for a while.

Looks like the only possible problem would be from code that parses a
string with some separator, then *expects* the url to have the other
separator -- and that doesn't sound like a healthy coding decision.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.