Yup, juxt is definitely useful, but you need to understand what it is really
doing.
In your case you have three “functions” and you’re invoking them each with two
arguments. Let’s look at those:
(:who {:who 1 :when 2} missing) ;; where missing is {:who 4 :what 99} => 1
(:what {:who 1 :when 2} m
A lot of your questions are front-end only so I think it would be hard to fit
them consistently into the State of the Union survey as it is structured today.
That’s not to say it won’t change to be closer to what you’re asking but it
brings up an interesting question in my mind…
It feels to me
juxt uses each of the functions supplied on all of your arguments. The
hash-map for :what is because (:what {} :default) returns :default - it's
invoking get, which takes an optional "not found" argument.
On Sat, Jul 15, 2017 at 8:52 PM wrote:
> If I do this:
>
> ((juxt :who :what :when) {:who 1
If I do this:
((juxt :who :what :when) {:who 1 :when 2} {:who 4 :what 99})
I get:
[1 {:who 4, :what 99} 2]
Why does a map come back instead of a number?
Does anyone use juxt in the real world, or is mostly for examples?
--
You received this message because you are subscribed to the Goo
Two thoughts:
1. Use an atom.
2. Use loop instead of doseq, so you can maintain a bit of state as you go.
-kt
On Saturday, July 15, 2017 at 6:18:10 PM UTC-4, Kevin Kleinfelter wrote:
>
> How does one detect a change in a doseq?
>
> I'm trying to do what data processing people would call a con
Partition the data. At its simplest:
(doseq [accounts (partition-by first account-funds)]
(doseq [account (first h), fund (second h)]
(println account fund)
(println "---"
You can also use destructuring to do without the let clause:
(doseq [accounts (partition-by
How does one detect a change in a doseq?
I'm trying to do what data processing people would call a control break in
a report. I'm printing account + fund names. My data is sorted by
account, so each row has a new fund, and accounts change less frequently.
I'd like to print a separator line
ps. just tried to access the surveymonkey page for the 2016
state-of-clojure survey. completely unusable on a mobile! pls consider
switching to a better provider for 2017!
On Jul 15, 2017 3:37 PM, "Gregg Reynolds" wrote:
> couple days ago somebody posted the following on the lua list. questio
couple days ago somebody posted the following on the lua list. questions
about web stacks/frameworks/etc. are pretty common for clojure, esp. for
newbies. so ditto for clojure (or: if there is an up-to-date summary of the
state of clojure web dev pls advise). maybe these qs or sth similar could
b
No the docs aren't out of sync, what you are seeing are gl's thousands of
constant declarations. They are used as arguments to various gl functions,
and I expose them as vars in the library. If you scroll down to the very
bottom you will see the implementation, which because of the design choice
10 matches
Mail list logo