[Prev][Next][Index][Thread]

Custom Parsers for Search URLs



At 2:44 PM -0500 1997-03-11, Bill Anderson wrote:
>question on url:search-keys parsing
>
>given a url-> #u"/dynamic-respond-to?foo=bar&baz=ralph&answer=a+b+c"
>
>(url:search-keys url) -> ((:|foo| "bar") (:|baz| "ralph") (:|answer| "a+b+c"))
>
>
>question 1
>
>? is there a reason why the fn url:parse-search-info-as-query-alist does
>not use the http:intern-keyword fn which does a string-upcase before the
>intern (which would have been nice in the above example) rather than an
>flet intern-keyword which does not do the string-upcase ? is this a bug
>or a feature (or neither)?

Because URLs are case-sensitive, we need to preserve case when we operate on
them. You could emit upper case keys, or you could define your own parser/printer
that is case insensitive. Perhaps, we should offer these as an option.
>
>question 2
>
>? given the above parsing (as query alist rather than standard), is
>there a correct way to represent a list of values ? for example, in the
>above url it would be nice if the alist for the keyword :answer was
>(:answer ("a" "b" "c")) rather than the (:answer "a+b+c")

In this case, + has no special meaning (we're using form url encoding).
However, you could provide your own parser to convert these into a list if
you like.

See the discussion in: 

http://wilson.ai.mit.edu/cl-http/show-documentation?HTTP%3AEXPORT-URL





Follow-Ups: References: