added example to parse-userhost / unparse->string

This commit is contained in:
interp 2002-05-12 05:52:57 +00:00
parent 97a7b52316
commit 7792db48f4
1 changed files with 17 additions and 2 deletions

View File

@ -51,8 +51,23 @@ only the parsing of http URLs is implemented.
\ex{userhost->string} just does the inverse job: it unparses
\semvar{userhost-record} into a string. The elements of the record
are escaped before the are put together.
are escaped before the are put together.
Example:
\begin{code}
> (define default
(make-userhost
"andreas" "se ret" "www.sf.net" "80"))
> (userhost->string default)
"andreas:se\%20ret@www.sf.net:80"
> (parse-userhost
'("" "" "foo\%20bar@www.scsh.net" "docu" "index.html")
default)
'#{userhost}
> (userhost->string ##)
"foo\%20bar:se\%20ret@www.scsh.net:80"
\end{code}
For details about escaping and unescaping see section ``Handle
URIs'' at page \pageref{sec:uri}.
\end{defundescx}