[email protected] writes:
Hi!
> I have a main function:
>
> (defn -main [& args]
> (let [{:keys [graph filepath title]} args]
> (cond
> (= graph "response") (graph-response filepath title)
> (= graph "requests") (graph-request filepath)
> (= graph "throughput") (graph-throughput filepath))))
>
> Which I can invoke with this call:
>
> (-main :graph "throughput" :filepath "./aggregate-report.csv")
Apparently, args is a sequence and you use map-destructuring on it. I
wonder why that should work here. That might just be a coincidence.
What should work is to create a map from the args seq first:
(let [{:keys [graph filepath title]} (apply hash-map args)]
...)
Bye,
Tassilo
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.