On Sun, Feb 28, 2010 at 6:26 PM, Richard Newman <holyg...@gmail.com> wrote:
>> For an example outside of JSON: recently Compojure changed how it
>> works so the HTTP request properties are all converted to keywords by
>> default. I can see the appeal, but now anyone using Compojure has the
>> increased incidental complexity of possible keyword violations.
>> Imagine if you were integrating with PayPal or some system that had
>> HTTP parameters with characters that were not allowed by the Clojure
>> spec. I really don't want to worry about such things when creating
>> software with Clojure.
>
> Per RFC2616, HTTP headers are named by "token"s:
>
>  token      = 1*<any CHAR except CTLs or separators>
>  CHAR       = <any US-ASCII character (octets 0 - 127)>
>  CTL        = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
>  separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> |
> "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
>
> As far as I can see, all valid HTTP headers are thus valid Clojure keywords.
> You don't have to worry.

Actually, HTTP headers are case-insensitive, so you can't really trust
a regular map of keywords for all purposes. You'd have to reify a
maplike construct (maybe a clojure.lang.IAssociative?) to take care of
case differences. No idea if ring or compojure does this already yet.

-Phil

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to