[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #699: add make-uri constructor to uri-generic and uri
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #699: add make-uri constructor to uri-generic and uri-common |
Date: |
Thu, 22 Sep 2011 19:15:29 -0000 |
#699: add make-uri constructor to uri-generic and uri-common
-------------------------+--------------------------------------------------
Reporter: syn | Owner: iraikov
Type: enhancement | Status: new
Priority: minor | Milestone: 4.8.0
Component: extensions | Version: 4.7.x
Keywords: |
-------------------------+--------------------------------------------------
Currently the only constructors for uri-generic and uri-common URI records
are {{{uri-reference}}} and {{{absolute-uri}}}. This is slightly
inconvenient when constructing a URI from individual components. For
example, when starting Spiffy one might want to construct the URI it can
be reached by. Currently one has to do something like this:
{{{
(update-uri (uri-reference "")
scheme: (if (secure-connection?) 'https 'http)
port: (server-port)
host: (or (server-bind-address)
"0.0.0.0"))
}}}
Whereas this would be much nicer:
{{{
(make-uri scheme: (if (secure-connection?) 'https 'http)
port: (server-port)
host: (or (server-bind-address)
"0.0.0.0"))
}}}
It also seems more complete to have {{{make-uri}}} in those eggs. Attached
is a patch that implements it for both eggs in terms of {{{update-uri}}}
so as to touch as little code as possible. Feel free to apply it or re-
implement it the other way around :-)
--
Ticket URL: <http://bugs.call-cc.org/ticket/699>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #699: add make-uri constructor to uri-generic and uri-common,
Chicken Trac <=