I'd prefer an option map over kwargs in general, and I wouldn't namespace
the options because they're not something that I'd expect to stick around.

(fetch url {:timeout 10})

Regarding the output, if it's a Ring response map, I'd be inclined to leave
the keywords bare for compatibility. If it's not, then namespaced keywords
become more tempting to me, so long as the namespace can be aliased for
brevity:

(api/fetch url {:timeout 10})
=> #::api{:status 200, :body ""}

On Mon, 1 Oct 2018 at 02:45, Michael Gardner <gardne...@gmail.com> wrote:

> I'm looking for some feedback on keyword namespacing. Say you're writing
> an API to be used by external clients that works something like this:
>
> (fetch url :timeout 10)
> => {:status 200, :body "..."}
>
> Would you namespace the :status and :body keywords in the response? What
> about the :timeout kwarg in the function call? Why or why not?
>
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
James Reeves
booleanknot.com

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to