summaryrefslogtreecommitdiff
path: root/module/web/uri.scm
diff options
context:
space:
mode:
authorDaniel Hartwig <mandyke@gmail.com>2013-03-16 17:53:53 +0800
committerDaniel Hartwig <mandyke@gmail.com>2013-03-16 17:53:53 +0800
commitdc8712611597c6d5be918a69b0ce719e0675f6fe (patch)
tree72e3e7a6cf3538e12a322ee56960215f2c320f81 /module/web/uri.scm
parent01b83dbd1a11735519b7d6ca7b02006b45861c9c (diff)
downloadguile-dc8712611597c6d5be918a69b0ce719e0675f6fe.tar.gz
minor tweaks to web documentation
* doc/ref/web.texi: Say `World Wide Web'; the hyphenated form is almost never used (c.f. w3.org). General predicate arguments are named `obj'. Fill in arguments omitted from some procedure definitions (e.g. `request-method'). Minor tweaks, such as using en-dash and missing markup as appropriate. Wrap very long deffn lines. * module/web/*.scm: Expand texinfo markup in doc strings. Synchronize with changes in web.texi.
Diffstat (limited to 'module/web/uri.scm')
-rw-r--r--module/web/uri.scm28
1 files changed, 13 insertions, 15 deletions
diff --git a/module/web/uri.scm b/module/web/uri.scm
index 25406b368..7fe010096 100644
--- a/module/web/uri.scm
+++ b/module/web/uri.scm
@@ -53,8 +53,8 @@
(query uri-query)
(fragment uri-fragment))
-(define (absolute-uri? x)
- (and (uri? x) (uri-scheme x) #t))
+(define (absolute-uri? obj)
+ (and (uri? obj) (uri-scheme obj) #t))
(define (uri-error message . args)
(throw 'uri-error message args))
@@ -309,17 +309,16 @@ serialization."
which should be the name of a character encoding.
Note that this function should not generally be applied to a full URI
-string. For paths, use split-and-decode-uri-path instead. For query
+string. For paths, use ‘split-and-decode-uri-path’ instead. For query
strings, split the query on ‘&’ and ‘=’ boundaries, and decode
the components separately.
-Note also that percent-encoded strings encode @emph{bytes}, not
-characters. There is no guarantee that a given byte sequence is a valid
-string encoding. Therefore this routine may signal an error if the
-decoded bytes are not valid for the given encoding. Pass ‘#f’ for
-ENCODING if you want decoded bytes as a bytevector directly.
-@xref{Ports, ‘set-port-encoding!’}, for more information on
-character encodings.
+Note also that percent-encoded strings encode _bytes_, not characters.
+There is no guarantee that a given byte sequence is a valid string
+encoding. Therefore this routine may signal an error if the decoded
+bytes are not valid for the given encoding. Pass ‘#f’ for ENCODING if
+you want decoded bytes as a bytevector directly. ‘set-port-encoding!’,
+for more information on character encodings.
Returns a string of the decoded characters, or a bytevector if
ENCODING was ‘#f’."
@@ -380,11 +379,10 @@ ENCODING was ‘#f’."
UNESCAPED-CHARS.
The default character set includes alphanumerics from ASCII, as well as
-the special characters @samp{-}, @samp{.}, @samp{_}, and @samp{~}. Any
-other character will be percent-encoded, by writing out the character to
-a bytevector within the given ENCODING, then encoding each byte as
-‘%HH’, where HH is the hexadecimal representation of
-the byte."
+the special characters ‘-’, ‘.’, ‘_’, and ‘~’. Any other character will
+be percent-encoded, by writing out the character to a bytevector within
+the given ENCODING, then encoding each byte as ‘%HH’, where HH is the
+hexadecimal representation of the byte."
(define (needs-escaped? ch)
(not (char-set-contains? unescaped-chars ch)))
(if (string-index str needs-escaped?)