Ah, I misunderstood your requirements, but I'm glad it led you in the
right direction!
On Fri, Aug 16, 2013 at 10:40 PM, David Chelimsky dchelim...@gmail.com wrote:
Thanks for the suggestions Sean and Ben. I learned new functions from both
of you!
Sean, your suggestion yields the following:
At first I came up with the same solution as your second one. But I
couldn't help but feel that it wasn't descriptive enough. It felt too
incidental-complexity-ish.
To me, (into {} the-map) seems mostly right. But obviously it would just
squash the values you need. So I figured it should just be
Wow. Sorry for the awful formatting. Re-pasting it from Google Groups
(instead of email) to fix it:
(def a [[:a 1] [:b 2] [:a 3]])
(defn add-maybe [ nums]
(- nums
(remove nil?)
(reduce +)))
(reduce (fn [m [k v]]
(update-in m [k] add-maybe v))
{}
Oh. Wow, I should read the whole thread before posting. Seems like
merge-with is what I was looking for. Although, lately both partial and
apply make me a little uneasy in terms of efficiency. But that's easily
enough solved with an anonymous function, which I don't think is any less
readable
Of your proposed solutions, this one
(defn to-consolidated-map [parts]
(- parts (map (partial apply hash-map)) (apply merge-with +))
Is the one I thought of first and also find very readable.
On Saturday, August 17, 2013, David Chelimsky wrote:
Sorry - pressed send before refreshing and
Sean, it sounds like you want
(swap! some-a update-in [:k1 :k2] (fnil conj []) id)
But that's based on some pretty limited context.
On Friday, August 16, 2013, Sean Corfield wrote:
On Fri, Aug 16, 2013 at 4:32 PM, Timothy Baldridge
tbaldri...@gmail.comjavascript:;
wrote:
I'm just going
if any of you are in Cambridge (UK) next Thursday evening, you're be
welcome to join us at the next Camclj Meetup. Details below.
-- Forwarded message --
From: Ray Miller r...@1729.org.uk
Date: 17 August 2013 15:47
Subject: Hands-on Clojure: Collaborative Filtering
To:
Hi,
I'm trying to create this Domain Specific Language:
(query clojure
(directory /usr/texts)
(group-by :creation-date))
What it should do is to search for all files in a specific directory using
a regexp and then group the result by some of files attributes.
The idea is the
Hussein B.:
Hi,
I'm trying to create this Domain Specific Language:
(query clojure
(directory /usr/texts)
(group-by :creation-date))
Any starting points are really appreciated.
Take a look at
Some Java frameworks will accept public final fields as Java bean fields.
In that case, a Clojure record can be used directly (although I'm not sure
if we're making an assumption about Clojure records that might change).
This has actually worked for my limited needs in this space.
The only
After upgrade to 2.3.1, I can't find repl-port file in target directory,
so lein repl will use a random port, I have to use LEIN_REPL_PORT=33021
lein repl to assign the port.
2013/8/14 Sean Corfield seancorfi...@gmail.com
Thank you!
I've upgraded our team to 2.3.1, as well as our QA system.
Interesting discussion - I was pretty surprised to see this can happen
I don't understand all the details about the solutions discussed in this
thread, but it seems that the only way to ensure no local can be clobbered,
gensym'ed or not, is to introduce into the RT a local resolution phase
Yeah, I totally agree that using core fns instead of anonymous fns makes
code way more readable and easier to mentally scan. The main reason I
suggested the anonymous function was for performance, which is probably
premature-optimization at this point. But I think I agree with you and Jay,
that
Thanks Laurent, I did as you suggest and things seem to be fine now. I
ended up using :profiles = :dev = :source-paths in my project.clj to
include the 'dev-resources' directory. Seems to be in use when I lein repl,
but is not included when I build a jar. Probably there are other problems
Gosh darn... yes, that is what I want. That must be the only
combination of things I didn't try! Thank you.
On Sat, Aug 17, 2013 at 4:18 AM, Jay Fields j...@jayfields.com wrote:
Sean, it sounds like you want
(swap! some-a update-in [:k1 :k2] (fnil conj []) id)
But that's based on some pretty
Hi folks,
I'm starting work on a Clojure Web app and would like to get a sense for
the current standard (if any) for deploying to production. In my case, I
have an AWS Ubuntu instance, set up via Vagrant and Puppet, which mirrors
some developer VMs. Datomic, leiningen etc. are running
Hi,
Random thought from a very tired person. :)
Programmers manipulate tiny pieces of reality, so tiny that quantum effects
come into play. [1]
Many of us (unknowingly) train our visual senses to help us calculate these
strange manipulations with less strain. Maybe if we train it on too
On 17 August 2013 21:52, John Jacobsen eigenhom...@gmail.com wrote:
So, what do all y'all do? What is a good lightweight but robust way to get
a fairly simple Compojure/Ring app backed by Datomic facing the outside
world? Not too worried about massive scalability at this point; simplicity
Cool, let me know how it works out for you
On Saturday, August 17, 2013 5:01:46 AM UTC+3, Casper Clausen wrote:
Nice work. Looking forward to giving it a spin.
On Thursday, August 15, 2013 12:13:11 PM UTC+2, ronen wrote:
Swagger https://developers.helloreverb.com/swagger/ is a cool project
What do you mean by currying in this context? Is there a way to do this in
clojure apart from using partial?
On Saturday, August 17, 2013 10:04:23 AM UTC+10, Sean Corfield wrote:
I went down the partial path for a long time but have moved more and
more toward currying and closures lately as
My overall sense is that the convenience of using if-let directly in a few
use cases doesn't justify making channels fall short of being able to send
arbitrary values (nil specifically, and clearly boolean false can cause
some problems too).
I think it would be a much better design to have a
On Sat, Aug 17, 2013 at 5:43 PM, yair yair@gmail.com wrote:
What do you mean by currying in this context? Is there a way to do this in
clojure apart from using partial?
(defn some-func
([a b c] (process a b c))
([a b] (fn [c] (some-func a b c)))
([a] (fn ([b] (fn [c] (some-func
That's precisely the design followed by Magpie, described here:
http://journal.stuffwithstuff.com/2013/04/17/well-done/
Parts 1 2 of that series are worth reading too.
On Sat, Aug 17, 2013 at 8:48 PM, Mikera mike.r.anderson...@gmail.comwrote:
My overall sense is that the convenience of using
A sentinel value also prevents channels from being able to send/receive
arbitrary values, without further wrapping.
Sent from my iPhone
On Aug 17, 2013, at 5:48 PM, Mikera mike.r.anderson...@gmail.com wrote:
My overall sense is that the convenience of using if-let directly in a few
use
Leonardo, that's an interesting solution, thanks for writing it out and
giving me some food for thought.
My thought process was that at this point I have a pure API that either
gets the right inputs or it simply does nothing. As in, no helping messages
about what went wrong, no attempt to do
On Sun, Aug 18, 2013 at 6:52 AM, John Jacobsen eigenhom...@gmail.comwrote:
After some prototyping and development, we are now getting to the stage
where lein run and a Jetty server running from -main aren't going to cut
it.
At the risk of asking a dumb question, but being quite new to
26 matches
Mail list logo