On Wed, May 28, 2014 at 11:18:14AM +0200, Kristian Lein-Mathisen wrote:
> I realize I already put down my vote, but I'd like to promote my case after
> some thought. I guess what we're trying to find out is what's more
> troublesome and/or surprising:
> 
> 1. having to set the port explicitly (to #f?) when you want to change the
> scheme and its port
> 2. having to set the port explicitly back to its original value if you want
> to change scheme but not its port
> 
> I don't think it's unreasonable to expect the user to realize he/she has to
> change the port if he/she changes the port (as in 1.). That requires an
> understanding of the relationship between scheme and port by the user.

I've now (finally!) changed the implementation not to switch ports when
changing schemes (in uri-common trunk).  However, taking a look at this
behaviour caused me to question another thing:

If a port is the default port for the scheme, should it be kept around?
Right now, if you do (update-uri uri scheme: 'http port: 80) it will
clear the port.  This is done so that the uri will be printed as
http://foo/bar rather than http://foo:80/bar, which would be redundant.

Unfortunately, that also means that (uri-port (update-uri uri port: x))
may return either x or #f.  And if you
(update-uri (update-uri uri port: 80 scheme: 'http) scheme: 'https) that
will result in the port not being 80.

I can keep it like this, but I can also keep around the selected port.
If that's done, it can still be decided to print the URI as
http://foo/bar even if the (uri-port uri) returns 80.

So here's a new poll:

a) The current behaviour of resetting port to #f if it's the default port
     for this scheme is ok.
b) The port should not be reset, and the uri should be printed with an
    explicit port, even if it's the default for this scheme.
c) The port should not be reset, but the uri should be printed without
    port if it's the default for this scheme.

Once results are in, I'll adjust the behaviour accordingly, and make a
new uri-common release.

Cheers,
Peter
-- 
http://www.more-magic.net

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to