Re: Pattern of Succinctness

2012-08-12 Thread Bill Caputo
On Aug 12, 2012, at 12:38 PM, Tamreen Khan wrote: > (filter #(not (nil? %)) coll) > (filter identity coll) ;; nearly equal > Is the last one considered generally more readable? I think the following is > clearer while still not having as much noise as the first filter example: > > (filter (part

Re: How to speed up Clojure Training for New Recruitment

2012-06-18 Thread Bill Caputo
On Jun 18, 2012, at 6:37 AM, Murtaza Husain wrote: > Bill that is very interesting. So how do you make them learn. Haha, I don't make anyone do *anything* on my team (I'm not exaggerating). My first (and more or less last) directive as team-lead is to declare it a team of peers. We ask people

Re: How to speed up Clojure Training for New Recruitment

2012-06-18 Thread Bill Caputo
On Jun 18, 2012, at 2:11 AM, Murtaza Husain wrote: > Hi, > > Just wanted to get pointers on how do you manage the training of recruits. It > is difficult to find clojure talent, I don't hire based on knowledge, I hire based on ability/desire to *learn*. For senior people I also want the same

Re: why String is not a collection (of Character)

2012-06-08 Thread Bill Caputo
On Jun 8, 2012, at 2:21 AM, Cédric Pineau wrote: > > 2012/6/8 Cédric Pineau > > 2012/6/8 Ambrose Bonnaire-Sergeant > No. I assume you mean seqable. > > If it did exist, it would look something like: > > Is there a simple test for sequable? > > Oh ok, I don't get the difference between seq

Re: (#({:a %}) :b)

2012-06-03 Thread Bill Caputo
On Jun 3, 2012, at 9:35 PM, James Reeves wrote: > On 4 June 2012 03:00, Bill Caputo wrote: >> Someone with more knowledge than me can probably explain better, but my >> understanding is that the the reader macro shorthand for anonymous functions >> and the map literal synt

Re: (#({:a %}) :b)

2012-06-03 Thread Bill Caputo
On Jun 3, 2012, at 8:53 PM, Steven Obua wrote: > The expression > > (#({:a %}) :b) either: (#(hash-map :a %) :b) ((fn [x] {:a x}) :b) will work instead. Someone with more knowledge than me can probably explain better, but my understanding is that the the reader macro shorthand for anonymo

Re: "when" function

2012-05-21 Thread Bill Caputo
On May 21, 2012, at 10:54 AM, Christian Guimaraes wrote: > I'm struggling with "when" code structures and my imperative mindset. > > What is the better approach (or functional approach) to work with a code like > the below? I think you're looking for cond (from memory, syntax might be wrong): (

Re: defrecord with "inheritance"

2012-05-20 Thread Bill Caputo
On May 20, 2012, at 4:23 PM, Warren Lynn wrote: >> defrecord, deftype, and defprotocol provide extensible low level >> abstractions like the kind Clojure is built on. >> >> As a Clojure programmer you should only need them rarely. >> >> As a beginner you should never use them. > Well, I don't w

Re: how to get good at clojure?

2012-05-08 Thread Bill Caputo
On May 7, 2012, at 7:48 PM, toan wrote: > > 1. does anyone have advice on getting somewhat > competent for a newb? (alternatively, how did you get good?) Can't recommend 4clojure ( http://www.4clojure.com/ ) highly enough; work through each one, turn on the code golf feature, and subscribe (at l

Re: clojurewest talk videos?

2012-03-19 Thread Bill Caputo
Alex, I never signed the release (my apologies) - but I'm fine with it... any alt. release I can provide? Bill - On Mar 19, 2012, at 9:33 AM, Alex Miller wrote: > Yes, all talks were recorded and will be released on http://infoq.com > starting in about 3 weeks on a rolling basis. > > Al

Re: Question about this little method I wrote

2012-02-27 Thread Bill Caputo
Here's a version that uses destructuring (but is otherwise the same) that cleans it up a bit: (defn combinations [[x & xs]] (if xs (for [frstitems x tlitm (combinations xs)] (flatten (list frstitems tlitm))) x)) On Feb 26, 2012, at 9:45 PM, Mike Ledoux wrote:

Re: Clojure 1.3 updated cheatsheet with links to clojuredocs.org

2012-02-27 Thread Bill Caputo
On Feb 27, 2012, at 1:22 AM, Andy Fingerhut wrote: > Thanks to several people who provided feedback, especially Steve Miner, and > to Alex Miller for updating the web site yet again, there is a new cheatsheet > at: This is fantastic guys... thank you. One question: if one wants to help out wi

Re: -> and ->>

2012-02-08 Thread Bill Caputo
On Feb 8, 2012, at 10:16 AM, Simon Holgate wrote: > Could anyone point me to a description of "->" and "->>", please? Another thing to check out is Fogus' nice write up (and links) about these and other "thrushy" combinators: http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/ bill --

Re: SoftCaching in core.cache

2012-02-02 Thread Bill Caputo
On Feb 2, 2012, at 4:47 AM, Teemu Antti-Poika wrote: > On Feb 1, 7:01 pm, Bill Caputo wrote: >> We are looking to add soft-reference based caching to one of our >> applications and I was wondering if anyone could shed light on what the >> issues with clache's impl

Re: SoftCaching in core.cache

2012-02-01 Thread Bill Caputo
On Feb 1, 2012, at 1:25 PM, Fogus wrote: > Oddly enough it was leaking memory, but suspect it had to do with the > queue reaper. I'd think that what's in Clache needs only a little > work. Patches welcomed. Thanks, we'll likely take a look at it then. If we patch it, we'll send something alon

SoftCaching in core.cache

2012-02-01 Thread Bill Caputo
Hello All, Looking at the docs for core.cache: https://github.com/clojure/core.cache There is mention that support for SoftCache (caching using soft references) is not supported as the clache implementation was buggy and so not (yet) brought over. We are looking to add soft-reference based cac

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread Bill Caputo
On Tue, Jan 3, 2012 at 2:11 PM, JuanManuel Gimeno Illa wrote: > I'm not 100% sure but this is a side effect of the property that symbols can > be used as functions that find themselves on maps. Thanks Juan Manuel - that's the thing I was missing (and thanks for the source link). bill -- You r

Understanding the quoting of a symbol in a list

2012-01-03 Thread Bill Caputo
Hi All, So, I've been doing some experimentation in order to better understand the reader, and I can't figure out why I get the following results for these four calls: => ('foo); ((quote foo)) java.lang.IllegalArgumentException: Wrong number of args (0) passed to: Symbol (NO_SOURCE_FILE:0

Re: Merging maps based on custom priority logic

2011-12-25 Thread Bill Caputo
On Sun, Dec 25, 2011 at 10:37 AM, Baishampayan Ghose wrote: > Shoeb wants to merge sequences of maps and not the maps themselves, so > merge/merge-with won't help him much. Sorry, I may have misunderstood, I was thinking something like this (where select-code implements his selecting codes from t

Re: Merging maps based on custom priority logic

2011-12-25 Thread Bill Caputo
On Sun, Dec 25, 2011 at 10:25 AM, Shoeb Bhinderwala wrote: > I want to merge lists of maps. Each map entry > I have written the > implementation. > [...] > Is there a more efficient, cleaner > and idiomatic way to do this. Am I missing out on any core library > functions that already provide this

Re: Implementing a clojure-only periodic timer...

2011-12-02 Thread Bill Caputo
On Dec 1, 2011, at 11:02 PM, Benny Tsai wrote: > Overtone's 'at-at' library is a thin Clojure wrapper over > ScheduledThreadPoolExecutor with a nice interface. I think you should be > able to build a timer on top of it pretty easily. > > https://github.com/overtone/at-at Thanks Benny; I went

Re: Implementing a clojure-only periodic timer...

2011-12-01 Thread Bill Caputo
On Dec 1, 2011, at 11:45 AM, gaz jones wrote: >Hey Bill, I would have thought you would have to have a pretty good >reason for not using an executor for this? Just that I really never spent much time as a Java programmer, so evaluating the merits/tradeoffs/gotchas of using native (and 3rd party)

Implementing a clojure-only periodic timer...

2011-12-01 Thread Bill Caputo
Hi All, I am currently considering an approach similar to the following for periodically sending an update to an agent and I'm looking for feedback on whether there is anything wrong with it, whether it's idiomatic clojure (sorry I'm in the pro-that-term camp) and whether there are other pure-cloj

Re: Lookup on a symbol?

2011-11-27 Thread Bill Caputo
On Nov 24, 2011, at 12:32 AM, Sean Corfield wrote: > @lloyda2 posted on Twitter: (reduce 'and '(false true)) => true ...Huh? > > I must admit, it looked odd to me... but I realized (after some REPL > experimentation) this seems to be equivalent to ('some-symbol > :some-key :some-default) I saw