Padding missing elements in a sequence of identical K/V maps

2013-11-19 Thread Colin Yates
Hi all, I have a sequence of {:key K :value V} maps. There is no guarantee that there is one map for every known K. I need to ensure that there is a map for each known K. Imagine the sequence represents a distribution between 1 and 5. The initial sequence might only be [{:key 3 :value 30}

Re: Padding missing elements in a sequence of identical K/V maps

2013-11-19 Thread Colin Yates
Great stuff - thanks Jim. (not sure why my previous post got lost) On Tuesday, November 19, 2013 11:48:17 AM UTC, Jim foo.bar wrote: On 19/11/13 11:42, Jim - FooBar(); wrote: On 19/11/13 11:29, Colin Yates wrote: Imagine the sequence represents a distribution between 1 and 5

Re: cider status

2013-11-19 Thread Colin Yates
That's the culprit - I was wondering why nrepl wouldn't disappear! For me, cider has been rock solid with midje-mode, but I am not really exercising it too much. On Tuesday, November 19, 2013 2:56:05 PM UTC, Phillip Lord wrote: I discovered one of the reasons for my issues with stability

Re: configure leiningen to use library when repl starts

2013-11-19 Thread Colin Yates
Something that works is putting :injections [(require 'clojure.repl)] in .lein/profiles.clj. It works (as evidenced by (doc ...) working in lein repl) but I don't know if that is the correct approach. On Tuesday, November 19, 2013 4:57:48 PM UTC, Andy Smith wrote: Hi, total newbie here

Re: Do web apps need Clojure?

2013-11-19 Thread Colin Yates
this. The ease of which data can be mangled and transformed was the primary reason I chose Clojure over Java, Groovy and Scala. That, and the fact the language is just so darn expressive. On Thursday, November 14, 2013 8:56:59 AM UTC, Islon Scherer wrote: For me it's about 1 thing: Data. A

Re: Padding missing elements in a sequence of identical K/V maps

2013-11-20 Thread Colin Yates
} {:key 5, :value nil}] -8-8- Cheers, Josh On Tuesday, November 19, 2013 at 2:00 PM, Jim - FooBar(); wrote: On 19/11/13 11:29, Colin Yates wrote: In Java I would do something like: // create a convenient look up to avoid nasty N^2 lookups MapObject

Re: java.jdbc DSLs (java.jdbc.sql / java.jdbc.ddl)

2013-11-20 Thread Colin Yates
Hi Sean, First - I hugely appreciate the work you have done and use java.jdbc daily. However, as a complete newbie I found the included DSL very unhelpful. The java.jdbc API is very wide and navigating it was hard, Particularly as it was in a transition from using bound *db* to not, so

Re: java.jdbc DSLs (java.jdbc.sql / java.jdbc.ddl)

2013-11-24 Thread Colin Yates
Perfect. --- Original Message --- From: Sean Corfield seancorfi...@gmail.com Sent: 24 November 2013 05:26 To: clojure@googlegroups.com Subject: Re: java.jdbc DSLs (java.jdbc.sql / java.jdbc.ddl) On Sat, Nov 23, 2013 at 8:27 PM, Keith Irwin ke...@devtrope.com wrote: Personally, the DSL doesn’t

Re: Good learning resources for Clojure novice but with a long background i programming, both OO and some Fp?

2014-01-10 Thread Colin Yates
For me (a similarly entrenched OO guy) I found it very challenging. Nothing to do with the syntax, but you are moving from a world of locked up bits of data behind a (hopefully) impenetrable API to a world full of lightweight data with a myriad of tiny functions which pretty much all perform

How can I improve this?

2014-01-10 Thread Colin Yates
I have a sequence of file names and I want to make them unique. (uniquify [a b c a]) = [a b c a_1]) This is what I have come up with, but surely there is a better way? What would you all do? Feedback welcome (including the word 'muppet' as I am sure I have missed something simple) :) (defn

RE: How can I improve this?

2014-01-10 Thread Colin Yates
code is a good reference. Thanks On Fri, Jan 10, 2014 at 6:59 AM, Colin Yates colin.ya...@gmail.com wrote: I have a sequence of file names and I want to make them unique. (uniquify [a b c a]) = [a b c a_1]) This is what I have come up with, but surely there is a better way? What would you all do

Re: How can I improve this?

2014-01-10 Thread Colin Yates
you've seen so far. You might also look at the implementation of distinct in clojure.core which is similar (you want to detect duplicates in the same way, but emit new names instead of omitting dupes). On Friday, January 10, 2014 8:59:10 AM UTC-6, Colin Yates wrote: I have a sequence

Re: How can I improve this?

2014-01-10 Thread Colin Yates
Love it. Much more readable without any nasty persistent state. On Friday, 10 January 2014 15:19:03 UTC, Ray Miller wrote: On 10 January 2014 14:59, Colin Yates colin...@gmail.com javascript:wrote: I have a sequence of file names and I want to make them unique. (uniquify [a b c a]) = [a b

Re: How can I improve this?

2014-01-10 Thread Colin Yates
on the uPhine, sorry Le vendredi 10 janvier 2014, Colin Yates a écrit : I have a sequence of file names and I want to make them unique. (uniquify [a b c a]) = [a b c a_1]) This is what I have come up with, but surely there is a better way? What would you all do? Feedback welcome (including

Re: How can I improve this?

2014-01-10 Thread Colin Yates
This and Jonas' are my current favourites, for what that's worth. Keep the suggestions coming! On Friday, 10 January 2014 17:29:20 UTC, Laurent PETIT wrote: What about this one? Inspired by Stefan's, with more destructuring in loop, format-fn as a function, initial call to (seq) then

Re: Good learning resources for Clojure novice but with a long background i programming, both OO and some Fp?

2014-01-10 Thread Colin Yates
At the risk of self promotion*, have a read of https://groups.google.com/d/msg/clojure/rt-l_X3gK-I/K80axT77XzwJ - it is an excellent example of iterative compared to functional. You can see at least 4 distinct approaches to solving a fairly straight forward problem. It is a startlingly clear

Re: How can I improve this?

2014-01-10 Thread Colin Yates
way to take the wind out of our sails! Well spotted :). On Friday, 10 January 2014 19:39:45 UTC, puzzler wrote: Technically, all these solutions are flawed. With the input [a a a_1] you'll get back [a a_1 a_1] To truly address this, you need to also add the newly formatted filename

Re: How can I improve this?

2014-01-10 Thread Colin Yates
until it is unique, but I haven't got that far yet (without potentially blowing the stack!) Then I saw your 'recur' used outside of a loop which points the way... Thanks! On Friday, 10 January 2014 20:16:28 UTC, puzzler wrote: On Fri, Jan 10, 2014 at 11:52 AM, Colin Yates colin

Re: How can I improve this?

2014-01-10 Thread Colin Yates
))])) [[] {}] items)) (fact strings can be made unique (s/uniquify [a b c]) = [a b c] (s/uniquify [a b a c b b b b a]) = [a b a_1 c b_1 b_2 b_3 b_4 a_2]) On Friday, 10 January 2014 20:59:00 UTC, Colin Yates wrote: Sorry - wrong c/p: (first (reduce

Any libraries for creating Powerpoint and Excel files

2014-01-15 Thread Colin Yates
Hi all, Any one broken that ground before? Thanks, Col -- -- 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 with your

Re: Any libraries for creating Powerpoint and Excel files

2014-01-15 Thread Colin Yates
Point, but I don't know to what extent. Ragnar On Wednesday, 15 January 2014 09:08:09 UTC, Colin Yates wrote: Hi all, Any one broken that ground before? Thanks, Col -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: How to organize clojure functions? A clojure newbie here...

2014-02-04 Thread Colin Yates
I think the right (or maybe idiomatic is a better word) organisation is an effect of a very important cause - changing the way you think about a software system. Simplistically, OO promises to be a world full of chunks of knowledge and behaviour that politely ask other chunks to behave in a

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
I don't know. But maybe the lack of coverage tools is itself interesting? My (not quite formed/making this up as I go) view is that maybe coverage tools are there to address the implicit complexity in other mainstream languages and/or to help mitigate the risk of the potentially large and

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
On Tue, Feb 04, 2014 at 03:19:05AM -0800, Colin Yates wrote: I don't know. But maybe the lack of coverage tools is itself interesting? My (not quite formed/making this up as I go) view is that maybe coverage tools are there to address the implicit complexity in other mainstream

Re: Lessons Learned from Adopting Clojure

2014-02-04 Thread Colin Yates
Is there going to be online access during/after the event? I would greatly value seeing this, but probably not enough to travel from the UK to Chicago :). On Tuesday, 4 February 2014 12:06:06 UTC, Jay Fields wrote: tl; dr: I'm presenting Lessons Learned from Adopting Clojure in Chicago on

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
if there are any logical errors in your code which cause the branches to not be hit. Aaron On Tue, Feb 04, 2014 at 03:19:05AM -0800, Colin Yates wrote: I don't know. But maybe the lack of coverage tools is itself interesting? My (not quite formed/making this up as I go) view is that maybe

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
04, 2014 at 04:18:30AM -0800, Colin Yates wrote: Comments in line. On Tuesday, 4 February 2014 11:23:36 UTC, Aaron France wrote: I don't want to seem rude but I think you've drank a bit too much kool-aid. You know the phrase I don't want to seem rude doesn't actually do

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
programming's panacea? Aaron On Tue, Feb 04, 2014 at 06:12:18AM -0800, Colin Yates wrote: This has turned into an unconstructive argument and for whatever reason we don't seem to be communicating clearly. Shame as I (and probably most people on here) only want to help. You seem

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
automatically somehow gives you insight into the coverage of your tests. Which it does not. You still maintain this. On Tue, Feb 04, 2014 at 06:28:51AM -0800, Colin Yates wrote: I have no idea why you aren't gushing. I'm not gushing, and haven't gushed about anything technical for years

Re: lispy.el - a vi-like Paredit. Some Clojure features added.

2014-02-04 Thread Colin Yates
This looks excellent! Desperately trying to suppress the whole emacs/vi battle raging inside which has is now rising up again :). On Sunday, 2 February 2014 13:44:12 UTC, Oleh wrote: Hi all, I've recently added some Clojure support to https://github.com/abo-abo/lispy. A short description

Re: Lessons Learned from Adopting Clojure

2014-02-04 Thread Colin Yates
my thoughts on TDD. On Tuesday, February 4, 2014 7:24:21 AM UTC-5, Rafael Peixoto de Azevedo wrote: +1 from Melbourne :) I actually gave the talk in Melbourne, as part of YOW!. It was recorded and will be online at some point. On Tuesday, February 4, 2014 7:22:06 AM UTC-5, Colin Yates

Re: Lessons Learned from Adopting Clojure

2014-02-04 Thread Colin Yates
Without starting a flame war - how are you finding LightTable for production? Moving away from emacs and paredit would be quite hard and every time I look at LightTable I get really excited until I actually download and try it... That is almost certainly because I don't have the time to

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread Colin Yates
Interesting - thanks all. My experience of Light Table is quite close to Norman's, although I discounted that *in my case* to not spending enough time with it. Knowing a little about who Sean is (from following your blog/comments/clojure.jdbc, not stalking! :)) I put a lot of weight behind

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Colin Yates
Did I see a thread a while ago where doing this caught some people out because it wiped out some other performance switches? I can't find the thread. Apologies if I am spreading FUD On Wednesday, 5 February 2014 23:05:18 UTC, Alex Miller wrote: To override the default tiered

Re: Alternative - macro for threading sequences?

2014-02-06 Thread Colin Yates
To be honest I prefer the first although I get your point about the over simplification. If I were going anywhere with this it would be to generalise it into a provided processor, something like: (- :processor map things wrangle ... ) but I am not sure the cognitive load of the extra

Re: every? expected behavior

2014-04-08 Thread Colin Yates
Depends who is doing the expecting as to whether that behaviour is correct. Formal logicians, mathematicians, computer scientists etc. would respond sure, it is vacously true. For almost everybody else it feels wrong but is then true when you think about it a bit. I would suggest the

where as clojure-fill-docstring gone?

2014-04-08 Thread Colin Yates
I upgraded my emacs and clojure-fill-docstring seems to have disappeared. clojure-mode is still there and activated but no clojure-fill-docstring. Before I spend time hunting through changelogs has anybody else noticed? Is this expected? -- You received this message because you are

Re: where as clojure-fill-docstring gone?

2014-04-08 Thread Colin Yates
Hi Bastian, sucks being sick. You mention it was unnecessary - can you let me know the thing that made it redundant? I tried fill-paragraph but that doesn't quite work... On Tuesday, 8 April 2014 20:28:52 UTC+1, Bastien Guerry wrote: Hi Colin, Colin Yates colin...@gmail.com javascript

RE: where as clojure-fill-docstring gone?

2014-04-08 Thread Colin Yates
:33 +0200 Colin Yates colin.ya...@gmail.com writes: Hi Bastian, sucks being sick. You mention it was unnecessary - can you let me know the thing that made it redundant? It was less redundant than weird. I tried fill-paragraph but that doesn't quite work... Can you explicit what

Re: Real World Example

2014-04-09 Thread Colin Yates
Hello back! We are using Clojure on the JVM as the implementation language for a platform that will underpin our applications for the next decade. It is relatively new and so far we have implemented the analysis module which is essentially a generic charting engine. So far we have 5547

Re: Real World Example

2014-04-09 Thread Colin Yates
09:14:38 UTC+1, Colin Yates wrote: Hello back! We are using Clojure on the JVM as the implementation language for a platform that will underpin our applications for the next decade. It is relatively new and so far we have implemented the analysis module which is essentially a generic

Re: Real World Example

2014-04-09 Thread Colin Yates
Hi Fergal, Thanks for those links. I started using protocols and defrecords but I (maybe mistakenly) got the impression that they were frowned upon. As it turns out, maps (typically with a :type key) and multi methods go a long long way, but I still end up with fairly deep nesting of maps.

Re: Real World Example

2014-04-09 Thread Colin Yates
) at the moment, it's just wonderful. [1] https://github.com/zcaudate/adi Regards, Fergal Byrne On Wed, Apr 9, 2014 at 12:22 PM, Colin Yates colin...@gmail.comjavascript: wrote: Hi Fergal, Thanks for those links. I started using protocols and defrecords but I (maybe mistakenly

Re: Advice for building backend REST services from scratch using clojure

2014-04-11 Thread Colin Yates
As others have said - a more focused question would help. Our back end runs on ring + compojure using https://github.com/jkk/honeysql for querying and straight https://github.com/clojure/java.jdbc for writes. We use https://github.com/marick/Midje/wiki rather than clojure.test and

Re: Advice for building backend REST services from scratch using clojure

2014-04-11 Thread Colin Yates
you hives. On 11 April 2014 20:17, Colin Yates colin...@gmail.com javascript:wrote: As others have said - a more focused question would help. Our back end runs on ring + compojure using https://github.com/jkk/honeysql for querying and straight https://github.com/clojure/java.jdbc

Re: Extending a data model

2014-04-15 Thread Colin Yates
Multimethods are fantastic and do indeed work across namespaces if by across namespaces you mean you can defmethod in ns2 a defmulti in ns1. On Tuesday, April 15, 2014 2:56:30 AM UTC+1, Andrew Chambers wrote: An update, I read about protocols and multimethods. I think multimethods are a

Re: Style question (predicates)

2014-04-17 Thread Colin Yates
My 2p - I interpret the contract as being boolean. Truthy values are 'polymorphically' equivalent*1 so sure. The concern would be people relying on the implementation and treating the values as none-truthy (i.e. in your example relying on the fact it is a string being returned, so (=

Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
(This has been discussed before but as this is fairly subjective I am interested in whether people's opinion has changed) What are people's experiences around using keywords or defined accessors for navigating data structures in Clojure (assuming the use of maps)? Do people prefer using raw

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
:foo to foo. For navigating nested maps, get-in, update-in and assoc-in with keywords seem natural and practical to me. On 22 April 2014 10:43, Colin Yates colin...@gmail.com javascript:wrote: (This has been discussed before but as this is fairly subjective I am interested in whether people's

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
Nice. On Tuesday, April 22, 2014 11:36:06 AM UTC+1, Jim foo.bar wrote: there is really no reason to use `get-in` with keywords/symbols as they know how to look themselves up...in other words, you don't need to pay for any polymorphic calls : (get-in [:a :b :c :d] someMap) = (- someMap :a

Re: emacs - how to wean me off the family of Java IDEs

2013-05-01 Thread Colin Yates
So a few months after using emacs, I gotta say I love it. First I absolutely hated it with a passion, and it really highlights my (fast but) poor typing skills :). Like Clojure I guess it requires a very different mindset. My constant frustration now is deciding whether to spend the time

Re: emacs - how to wean me off the family of Java IDEs

2013-05-01 Thread Colin Yates
Without static typing, I guess grep is the best? On 1 May 2013 12:13, Ulises ulises.cerv...@gmail.com wrote: The biggest 'ah - got it' for me was when I realised IDEs are great for navigating huge object models which are relatively narrow but deep (i.e. lots of nested relationships). This

Struggling with encapsulation

2013-05-09 Thread Colin Yates
(newbie, but trying hard!) I am designing a Woobly. A Woobly is non-trivial and has a number of internal data structures (queues, worker threads etc.). You can 'add' and 'remove' jobs from a Woobly. In OO land I might have a Woobly interface with the various methods which provides a public

Re: Struggling with encapsulation

2013-05-09 Thread Colin Yates
a bunch - really helpful. On 9 May 2013 17:30, James Reeves ja...@booleanknot.com wrote: On 9 May 2013 17:07, Colin Yates colin.ya...@gmail.com wrote: The part I am struggling with is how to create a Woobly without exposing its internals. To what end? What's the benefit? If you take a look

Re: Struggling with encapsulation

2013-05-10 Thread Colin Yates
hairs, I genuinely want to improve my Clojure intuition. On 9 May 2013 21:05, James Reeves ja...@booleanknot.com wrote: On 9 May 2013 18:03, Colin Yates colin.ya...@gmail.com wrote: I am nervous as well about expose internals but trust people to do the right thing because in this case, if I

Re: Struggling with encapsulation

2013-05-10 Thread Colin Yates
external users of (woobly/create-woobly) can in theory dig into the internals of the woobly object, but it should be relatively obvious that this isn't a good idea. I'd defer making protocols until you actually need polymorphism. - Korny On 10 May 2013 03:03, Colin Yates colin.ya...@gmail.com

Not using dependency injection - how do I share services around?

2013-05-10 Thread Colin Yates
(newbie, getting better each day!) I assume we all know DI. Through the use of a central registry I can register a service (a bean in a Spring bean factory for example). I also define consumers of that service in the same registry passing in the configured *instance* of that service. In

Re: Struggling with encapsulation

2013-05-10 Thread Colin Yates
AM, Colin Yates colin.ya...@gmail.com wrote: Thanks Korny. Ok, the over-ridding theme seems to be: expose state, even if it is dangerous, but expect consumers to 'do the right thing' and read the documentation. I can see that. I guess I have worked (and to be honest, been guilty myself

Re: Struggling with encapsulation

2013-05-10 Thread Colin Yates
On 10 May 2013 14:10, James Reeves ja...@booleanknot.com wrote: Have you tried it? :) I've authored about 40 Clojure libraries over 5 years, some with data structures with internal components. The number of times someone has said I did X to this internal data and it broke is exactly zero.

Re: Not using dependency injection - how do I share services around?

2013-05-10 Thread Colin Yates
Thanks both - some good suggestions. After years of Java I am loving how 'symmetrical' everything is in Clojure (I guess in Lisp). Thanks for the library references. On 10 May 2013 14:14, Ben Mabey b...@benmabey.com wrote: Hi Colin, On 5/10/13 5:04 AM, Colin Yates wrote: 1) to use

Re: Struggling with encapsulation

2013-05-10 Thread Colin Yates
14:20, Colin Yates wrote: This is all about changing my mindset from 15-odd years of Java dev by learning from others, so let's give it a go. Years of enterprise Java dev have gotten their cynical, 'data is precious and should be hidden away', 'other devs will do the wrong thing' etc. claws

Re: Not using dependency injection - how do I share services around?

2013-05-10 Thread Colin Yates
Thanks Timo; Interesting links. Loving Clojure, but boy is it challenging the stuff I have been doing for the past how-ever many years :). On 10 May 2013 20:14, Timo Mihaljov t...@mihaljov.info wrote: On 10.05.2013 14:04, Colin Yates wrote: 2) to provide a 'get-ds' accessor which returns

Re: Not using dependency injection - how do I share services around?

2013-05-11 Thread Colin Yates
dependencies. You can easily add whatever dependencies you need. You don't have to think about it, you can work around problems that crop up. Does that help Colin? Sean On Fri, May 10, 2013 at 4:04 AM, Colin Yates colin.ya...@gmail.com wrote: (newbie, getting better each day!) I assume we

Re: Not using dependency injection - how do I share services around?

2013-05-11 Thread Colin Yates
Not specifically, nope. On 11 May 2013 10:37, Jimmy jimmy.co...@gmail.com wrote: Do any of the clojure books cover this topic? -- -- 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

idiomatic terminating infinite loops

2013-05-15 Thread Colin Yates
Hi all, I have a scheduler which creates a future that basically does a (while true (let [next-job (.take queue)]...)), where queue is a LinkedBlockingQueue. The problem is that once it is running, because futures aren't daemon threads it hangs lein. It will ultimately run inside a compojure

Re: Not using dependency injection - how do I share services around?

2013-05-15 Thread Colin Yates
, Jason On Friday, May 10, 2013 4:04:20 AM UTC-7, Colin Yates wrote: (newbie, getting better each day!) I assume we all know DI. Through the use of a central registry I can register a service (a bean in a Spring bean factory for example). I also define consumers of that service in the same

Re: Not using dependency injection - how do I share services around?

2013-05-15 Thread Colin Yates
/author/Stuart-Sierra On Saturday, May 11, 2013 10:48:02 AM UTC+2, Colin Yates wrote: Yes it does, thanks. It is amazing how much you can do in the typical spring/hibernate stack with a decent IDE without engaging your brain :). Clojure involves far less ceremony and really does expose

Re: idiomatic terminating infinite loops

2013-05-16 Thread Colin Yates
Thanks both, good suggestions. On 15 May 2013 23:38, Stuart Sierra the.stuart.sie...@gmail.com wrote: Colin Yates wrote: I have a scheduler which creates a future that basically does a (while true (let [next-job (.take queue)]...)), where queue is a LinkedBlockingQueue. The problem

Why are errors in nested futures suppressed?

2013-05-21 Thread Colin Yates
Hi all, If the function executed in a future throws an error it is printed out in the repl immediately. If that function is executed in a future which itself is executed in a future then it isn't. For example, imagine somebody wrote the following code (please, suspend belief and just accept

executing tests using clojure-test-mode in emacs throws ClassNotFoundException

2013-05-21 Thread Colin Yates
Hi, I am trying to get clojure-test-mode working in emacs from https://github.com/technomancy/clojure-mode. I have the nrepl working great, the problem is if I C-c, C-, in a test file then I get the clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: clojure.test.mode,

Re: executing tests using clojure-test-mode in emacs throws ClassNotFoundException

2013-05-21 Thread Colin Yates
https://github.com/technomancy/clojure-mode/issues/146#issuecomment-15447065 provides one solution - navigate to the source code and then start nrepl. On Tuesday, 21 May 2013 11:37:19 UTC+1, Colin Yates wrote: Hi, I am trying to get clojure-test-mode working in emacs from https

Structing Clojure tests/setup and tear down

2013-05-21 Thread Colin Yates
Howdy, I am using clojure.test and have some questions of how to write idiomatic Clojure. This really isn't about testing at all per-se. First - I know about fixtures to get (at least) the same as JUnit's before/after behaviour. My code is a bloomy. You can configure the bloomy and it does

Re: Structing Clojure tests/setup and tear down

2013-05-21 Thread Colin Yates
://thornydev.blogspot.co.uk/2012/09/before-and-after-logic-in-clojuretest.html U On 21 May 2013 15:17, Colin Yates colin.ya...@gmail.com wrote: Howdy, I am using clojure.test and have some questions of how to write idiomatic Clojure. This really isn't about testing at all per-se. First - I

Re: Structing Clojure tests/setup and tear down

2013-05-21 Thread Colin Yates
at 10:05 AM, Colin Yates colin.ya...@gmail.comwrote: Hi Ulises, I don't think I am as that would require essentially a fixture per distinct combinations of test state, which is almost the same number of tests. Have I missed something? On 21 May 2013 15:51, Ulises ulises.cerv...@gmail.com

Re: Structing Clojure tests/setup and tear down

2013-05-21 Thread Colin Yates
No worries ;) On 21 May 2013 17:18, Ulises ulises.cerv...@gmail.com wrote: Hey Colin, Apologies, I missed your First - I know about fixtures... line :) I'd probably +1 Gaz's macro (I've not tested it either but it looks reasonable.) On 21 May 2013 16:05, Colin Yates colin.ya

Re: A blocking lazy sequence populated by multiple worker threads

2013-05-30 Thread Colin Yates
Can you not use http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/LinkedBlockingQueue.html? That will provide the blocking element. To execute N (i.e. 10 in your example) use a http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html. The 'glue'

Re: A blocking lazy sequence populated by multiple worker threads

2013-05-30 Thread Colin Yates
Nice. On 30 May 2013 12:57, John D. Hume duelin.mark...@gmail.com wrote: On May 30, 2013 4:12 AM, Colin Yates colin.ya...@gmail.com wrote: ; the following would need to reify itself to be a Runnable, not got that far yet :) (defn execute [job result-queue] (let [result (job)] (.put result

Re: Please stand firm against Steve Yegge's yes language push

2011-07-08 Thread Colin Yates
I think we need to be careful here about the association between Java and Clojure. Sure, they run on the JVM, but that is their *only* relationship (from a consumer's point of view) as far as I can see. For me, after a decade+ of developing Enterprise Java (primarily web) applications I am sick

Re: Please stand firm against Steve Yegge's yes language push

2011-07-08 Thread Colin Yates
If it weren't for McDonalds I wouldn't have such a large belly, but my belly isn't McDonalds ;) I jest (obviously!), but I do think this is a fundamental point. I (like a lot of others I expect) found Clojure and Scala whilst looking for Java.next. I read a bit about Scala, and part of its

Recommendation for Clojure Enterprise Development toolkit

2011-07-08 Thread Colin Yates
*This isn't meant to start a flame-war!* I am pretty convinced that I want to use Clojure as my primary tool (in place of Java/Groovy Spring and Hibernate) in writing Enterprise applications on the JVM. By Enterprise I mean that my solution has to be very stable, maintainable by others, subject

Re: Recommendation for Clojure Enterprise Development toolkit

2011-07-09 Thread Colin Yates
for even suggesting to use Clojure as an enterprise greenfield. Industry and academia is moving towards advanced type systems. Nobody in industry seriously considers Clojure for enterprise systems. On Jul 8, 12:43 pm, Colin Yates colin.ya...@gmail.com wrote: *This isn't meant to start

Re: Recommendation for Clojure Enterprise Development toolkit

2011-07-09 Thread Colin Yates
. On Jul 8, 12:43 pm, Colin Yates colin.ya...@gmail.com wrote: *This isn't meant to start a flame-war!* I am pretty convinced that I want to use Clojure as my primary tool (in place of Java/Groovy Spring and Hibernate) in writing Enterprise applications on the JVM. By Enterprise I mean that my

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Colin Yates
-weight tools and fly! OK - that's enough. Or, it might all be a catastrophic failure and I will be signing up to Careers 2.0 :) Col P.S Usual disclaimer - still only written three lines of Clojure :) On 8 July 2011 20:57, James Keats james.w.ke...@gmail.com wrote: On Jun 16, 3:08 pm, Colin

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Colin Yates
, Colin Yates colin.ya...@gmail.com wrote: I did think about moving this logic to the database, but I am toying around with a different model - having the entire data set in memory (possibly across multiple nodes using messaging infrastructure to communicate). The reason

Re: Modelling complex data structures (graphs and trees for example)

2011-07-09 Thread Colin Yates
Nice link - many thanks On 9 July 2011 17:27, Benny Tsai benny.t...@gmail.com wrote: Hi Colin, Sorry, a bit late to the party here, but it might be worth taking a look at Jeffrey Straszheim's c.c.graph library to see one way of modeling DAG's and implementing various graph operations (such

Re: Recommendation for Clojure Enterprise Development toolkit

2011-07-09 Thread Colin Yates
I think he was being sarcy :) On 9 July 2011 22:03, Sean Corfield seancorfi...@gmail.com wrote: On Sat, Jul 9, 2011 at 1:52 PM, Shree Mulay shreemu...@gmail.com wrote: Clojure REALLY isn't ready for Enterprise level development. That's your opinion but I expect there are enterprise

Re: Recommendation for Clojure Enterprise Development toolkit

2011-07-10 Thread Colin Yates
But then how would all the consultants make their money? ;) Sent from my iPad On 10 Jul 2011, at 04:56, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Hey, if it does not take a year and an army of nuclear scientists to implement, it would already be better : On Sun, 10 Jul 2011

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Colin Yates
What other new shiny languages are there with any traction? Scala, and maybe F#? new and traction are pretty subjective. Sometimes (as in my case) the searcher just needs enough to sell themselves on the tool they have already chosen, i.e. just enough facts to fit my theory. FWIW, I like

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Colin Yates
That sounds more like Enterprise Java Development to me :) On 12 July 2011 13:20, Adam Burry abu...@gmail.com wrote: On Jul 12, 7:58 am, Colin Yates colin.ya...@gmail.com wrote: FWIW, I like clojure.org the way it is. Without sounding like a complete muppet, I think of Clojure as a set

Re: Results from 2011 State of Clojure survey

2011-07-12 Thread Colin Yates
Besides the languages itself, the outsider wants to evaluate libraries, community, platforms, support, etc. That could be much more challenging than comparing a few bare languages. Absolutely! I asked a couple of times for recommendations, and was quite surprised at the lack of forthcoming

Re: The Last Programming Language

2011-07-19 Thread Colin Yates
I find his videos very easy to watch - I think it was around a hour, but the time flies by. On 19 July 2011 14:16, Ken Wesson kwess...@gmail.com wrote: On Tue, Jul 19, 2011 at 6:00 AM, Adam Richardson simples...@gmail.com wrote: Watch the video and you'll see the comment Tim is referencing.

Re: The Last Programming Language

2011-07-19 Thread Colin Yates
Quite - you don't get the ants in your pants vibe from plain text :) On 19 July 2011 15:18, Ben Smith-Mannschott bsmith.o...@gmail.com wrote: On Tue, Jul 19, 2011 at 16:11, Ken Wesson kwess...@gmail.com wrote: On Tue, Jul 19, 2011 at 10:05 AM, Colin Yates colin.ya...@gmail.com wrote: I

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Colin Yates
Absolutely nothing to add to the argument as such except to say that I am quite surprised at the level of resistance to James' thread. I can see the argument if this was the 'dev' mailing list. I have been reading this mailing list for a long while now (even if I haven't contributed much to it)

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Colin Yates
+1 - I think an etiquette document needs to be written. On 25 July 2011 15:10, Steve stephen.a.lind...@gmail.com wrote: On Jul 25, 7:54 pm, James Keats james.w.ke...@gmail.com wrote: Best regards; love you, man, and sorry again for any misunderstanding or unintended miscommunication.

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-26 Thread Colin Yates
The irony of +1 doesn't escape me, but +1 Sent from my iPad On 26 Jul 2011, at 20:15, Base basselh...@gmail.com wrote: +1 On Jul 26, 12:31 pm, Devin Walters dev...@gmail.com wrote: Let's stop feeding this thread and turn our attention toward healthy and productive discussion. This is my

Good book on migrating from (Java) OO to FP

2011-07-29 Thread Colin Yates
Hi all, Not sure whether this is good etiquette or not, but I wanted to praise http://oreilly.com/catalog/0636920021667. I found it pretty useful in bridging the gap between OO and FP. It isn't Clojure specific, but as a (well established) Java/OO guy, this helped me get FP. (not connected in

Re: Good book on migrating from (Java) OO to FP

2011-07-29 Thread Colin Yates
asking you to convince me to let this book jump the queue. :^) On Jul 29, 5:03 am, Colin Yates colin.ya...@gmail.com wrote: Hi all, Not sure whether this is good etiquette or not, but I wanted to praisehttp://oreilly.com/catalog/0636920021667. I found it pretty useful in bridging the gap

Re: What information does (:key x) convey?

2011-08-03 Thread Colin Yates
+1 as well. Surely (start-date voyage) would be more explicit than (start voyage) though meaning there is no ambiguity for me; I would (incorrectly) assume (start voyage) was a mutator :) On 3 August 2011 18:22, Sean Corfield seancorfi...@gmail.com wrote: On Wed, Aug 3, 2011 at 10:03 AM, Brian

Re: Optimizing JDBC code

2011-08-06 Thread Colin Yates
That assumption needs checking - first rule of performance analysis: check, don't guess :) For example, is the java code using an existing connection versus clojure creating one? I would also time the cost of creating 10 clojure maps of a similar structure. Finally - 100,000 is big enough

Re: Out of memory using pmap

2011-08-06 Thread Colin Yates
The point is that sequentially the GC gets to remove stale entries so simplistically only 3000 records are in memory at any one time, in parallel processing all 9 can be in memory at the same time. Sent from my iPad On 6 Aug 2011, at 21:34, Shoeb Bhinderwala shoeb.bhinderw...@gmail.com

  1   2   3   4   5   6   >