You might be interested in https://github.com/guv/clojure.options/
--
--
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 wit
yes, thank you, that is what I was referring to + the :or and :as like:
(defn somefn
[req1 req2 ;required params
& {
:keys [a b c d e] ;optional params
:or {a 1 ;optional params with preset default values other than the
nil default
; b takes nil if not specified on c
atkaaz, you can do this: (fn [& {:keys [arg1 arg2 arg3]}] ...)
On Mon, May 6, 2013 at 10:03 PM, AtKaaZ wrote:
> I agree, I'm not sure what he means xD
> If you ask me, I'd rather have each arg be identified by a keyword instead
> of by order
> like: (somefn :arg1 "somestr" :arg3 100 :arg2 (+ 1
I agree, I'm not sure what he means xD
If you ask me, I'd rather have each arg be identified by a keyword instead
of by order
like: (somefn :arg1 "somestr" :arg3 100 :arg2 (+ 1 2))
or all those in a map
I'll probably still do that for me, so that any function will take params
like this. There's pro
Tell us more about it.
On Sunday, May 5, 2013 11:54:32 AM UTC+4, JvJ wrote:
>
> Is anyone else tripped out when they realize that when you write args for
> a function you're basically just destructuring an arg vector? It trips
> me out.
--
--
You received this message because you are sub
Yeah. It seems like the logical extension of this would be to allow (fn args
expr) to be equivalent to (fn [& args] expr)...but I'm not sure how useful that
would actually be.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group
We write all these s-exps, but in the end it's just convenient ways to
control electricity, and we are Magneto.
On Sunday, May 5, 2013, JvJ wrote:
> Is anyone else tripped out when they realize that when you write args for
> a function you're basically just destructuring an arg vector? It tr