Changeset 13217 in project


Ignore:
Timestamp:
02/08/09 16:07:19 (11 years ago)
Author:
sjamaan
Message:

Update uri-common docs to match the newly added predicates that match uri-generic's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/uri-common

    r13000 r13217  
    6767==== Predicates and Accessors
    6868
    69 * <procedure>(uri? uri-common) => bool</procedure>
    7069* <procedure>(uri-scheme uri-common) => symbol</procedure>
    7170* <procedure>(uri-path uri-common) => list</procedure>
     
    8584(ie, it creates a new copy with the modifications).
    8685
     86* <procedure>(uri? URI) => BOOL</procedure>
     87
     88Is the given object an URI-common object?
     89
     90* <procedure>(relative-ref? URI) => BOOL</procedure>
     91
     92Is the given object a relative reference?  Relative references are
     93defined by RFC 3986 as URI references which are not URIs; they contain
     94no URI scheme and can be resolved against an absolute URI to obtain
     95a complete URI using {{uri-relative-to}}.
     96
     97* <procedure>(absolute-uri? URI) => BOOL</procedure>
     98
     99Is the given object an absolute URI?  Absolute URI is defined by
     100RFC 3986 as a non-relative URI reference without a fragment.  Absolute
     101URIs can be used as a base URI to resolve a relative-ref against, using
     102{{uri-relative-to}}.
     103
    87104==== Reference Resolution
    88105
    89106<procedure>(uri-relative-to URI URI) => URI</procedure>
    90107
    91 Constructs an absolute URI given a relative URI and a base URI (RFC 3986, Section 5.2.2)
     108Resolve the first URI as a reference relative to the second URI,
     109returning a new URI (RFC 3986, Section 5.2.2).
    92110
    93111<procedure>(uri-relative-from URI URI) => URI</procedure>
     
    95113Constructs a new, possibly relative, URI which represents the location
    96114of the first URI with respect to the second URI.
     115
     116<examples>
     117<example>
     118<init>(use uri-common)</init>
     119<expr>(uri->string (uri-relative-to (uri-reference "../qux") (uri-reference "http://example.com/foo/bar/")))</expr>
     120<result>"http://example.com/foo/qux"</result>
     121</example>
     122<example>
     123<init>(use uri-common)</init>
     124<expr>(uri->string (uri-relative-from (uri-reference "http://example.com/foo/qux") (uri-reference "http://example.com/foo/bar/")))</expr>
     125<result>"../qux"</result>
     126</example>
     127</examples>
    97128
    98129==== Query encoding and decoding
     
    142173=== Version History
    143174
     175* trunk Add predicates for absoluteness/relativeness, matching the ones in uri-generic.
    144176* 0.1 Initial Release
    145177
Note: See TracChangeset for help on using the changeset viewer.