Hi,

This may be a question without hope, but I'm thinking that asking
never hurts. So here goes:

The closest thing to keyword arguments that I have found is
destructuring with a map:

(defn myfun [& {:keys [arg1 arg2 arg3]
                        :or {arg1 "default-value"} :as args}]
...)

When I call myfun without specifying value for arg2 or arg3 I get an
error, which is great. However, when I do this:

(myfun :arg2 2 :arg3 3 :arg15 15)

I don't get an error, because of the rest (&) thing. Do you know if
this can be achieved with a nice syntax, and not check args in the
code (i.e. checking should be done when evaluating/creating the
function, and not when executing).

Thanks,
Razvan

-- 
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