Changeset 13215 in project
- Timestamp:
- 02/08/09 15:54:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/eggref/4/uri-generic
r13112 r13215 45 45 ==== Predicates and Accessors 46 46 47 * <procedure>(uri? URI) => BOOL</procedure>48 47 * <procedure>(uri-authority URI) => URI-AUTH</procedure> 49 48 * <procedure>(uri-scheme URI) => SYMBOL</procedure> … … 70 69 functional way (ie, it creates a new copy with the modifications). 71 70 71 * <procedure>(uri? URI) => BOOL</procedure> 72 73 Is the given object an URI-generic object? 74 75 * <procedure>(relative-ref? URI) => BOOL</procedure> 76 77 Is the given object a relative reference? Relative references are 78 defined by RFC 3986 as URI references which are not URIs; they contain 79 no URI scheme and can be resolved against an absolute URI to obtain 80 a complete URI using {{uri-relative-to}}. 81 82 * <procedure>(absolute-uri? URI) => BOOL</procedure> 83 84 Is the given object an absolute URI? Absolute URI is defined by 85 RFC 3986 as a non-relative URI reference without a fragment. Absolute 86 URIs can be used as a base URI to resolve a relative-ref against, using 87 {{uri-relative-to}}. 72 88 73 89 ==== String and List Representations … … 88 104 <procedure>(uri-relative-to URI URI) => URI</procedure> 89 105 90 Constructs an absolute URI given a relative URI and a base URI (RFC 3986, Section 5.2.2) 106 Resolve the first URI as a reference relative to the second URI, 107 returning a new URI (RFC 3986, Section 5.2.2). 91 108 92 109 <procedure>(uri-relative-from URI URI) => URI</procedure> … … 94 111 Constructs a new, possibly relative, URI which represents the location 95 112 of the first URI with respect to the second URI. 113 114 <examples> 115 <example> 116 <init>(use uri-generic)</init> 117 <expr>(uri->string (uri-relative-to (uri-reference "../qux") (uri-reference "http://example.com/foo/bar/")))</expr> 118 <result>"http://example.com/foo/qux"</result> 119 </example> 120 <example> 121 <init>(use uri-generic)</init> 122 <expr>(uri->string (uri-relative-from (uri-reference "http://example.com/foo/qux") (uri-reference "http://example.com/foo/bar/")))</expr> 123 <result>"../qux"</result> 124 </example> 125 </examples> 96 126 97 127 ==== String encoding and decoding … … 160 190 === Version History 161 191 192 * trunk Add new predicates for absoluteness/relativeness. Fix absolute-uri so it raises a condition when passing in a non-absolute uri string, instead of returning a string with the error. 162 193 * 2.0 Export char-sets, add char-set arg to uri-encode/uri-decode, 163 194 do not decode query args as x-www-form-urlencoded, change path … … 188 219 189 220 190 Copyright 2008 Ivan Raikov, Peter Bex.221 Copyright 2008-2009 Ivan Raikov, Peter Bex. 191 222 All rights reserved. 192 223
Note: See TracChangeset
for help on using the changeset viewer.