Re: Convenient memoization with destructured arguments

2015-01-26 Thread Rob Lally
Graph from prismatic/plumbing [ https://github.com/Prismatic/plumbing ] provides memoization/delayed-execution allowing you to maintain a map-like structure whilst deferring and caching calculations. Rob. > On 26 Jan 2015, at 09:17, David James wrote

Re: Type checking in :pre conditions

2014-07-23 Thread Rob Lally
Hi Wes, I'd be on the "don't do that" side of the fence. I did something similar when I first moved from Java to a dynamically typed language (I suspect that most people do) and it hinders at least as much as it helps. For me, the thing that I needed to internalise is that Clojure isn't lacking

Re: Deterministic Randomness in Functional Clojure

2014-11-03 Thread Rob Lally
It might also be worth noting that the JDK ships with java.security.SecureRandom a subclass of java.util.Random. http://docs.oracle.com/javase/8/docs/api/java/security/SecureRandom.html R. On 1 Nov 2014, at 10:31, Mars0i wrote: > > > On Friday, October 31, 2014 11:19:19 PM UTC-5, Isaac

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-01 Thread Rob Lally
Hey Pablo, I could be wrong, but it seems that the key problem here is the existence of the global transaction. If the global transaction didn’t exist then any time you failed to pass in a transaction the code would fail: immediately and loudly. I appreciate what you’re trying to do but it seem

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-03 Thread Rob Lally
Hey Pablo, Sorry, you are completely correct: I accidentally typed transaction when I meant connection. My bad. I don’t understand what you mean by connections having to be global when dealing with an RDBMS. It is true that you normally want to pool them to conserve resources, and that pooling

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-03 Thread Rob Lally
; is started and retained for the lifecycle of the application. Creating the > additional hoops for the user to jump through for purely theoretical benefit > seems unwarranted in this scenario. > > > On Monday, August 3, 2015 at 6:48:05 PM UTC-4, Rob Lally wrote: > Hey Pablo, >

Re: Just found out about Elixirs function argument pattern matching...

2015-09-05 Thread Rob Lally
Out of interest, I ran the benchmarks as is, and got more or less the same results - 15x. Then I tried upgrading the defun dependencies - clojure, core.match and tools.macro - all of which have newer versions, and then running the benchmarks without leiningen’s jvm-opts and in a trampolined repl

Re: If a Java function seems to never return, how do I test?

2015-11-02 Thread Rob Lally
Is it possible that the exception is being thrown in a different thread? If that’s the case, you can use: https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.UncaughtExceptionHandler.html to captu

Re: another game of exploding heap, via clojure.string/split

2013-09-18 Thread Rob Lally
I've used YourKit extensively for profiling and analysis and would highly recommend it . Rob. On 17 Sep 2013, at 08:56, Andy Fingerhut wrote: > Some of the hits point at commercial tools, which you didn't mention. > > I've heard positive comments about YourKit in the past. It is commerci

Re: Persistent collections and garbage collection

2012-02-12 Thread Rob Lally
I suspect that the clojure is actually slightly better here than standard java collections. With standard java collections, you'll tend to associate a collection with some attribute or property of an object and then modify it over time. The chances of this object living to a later generation ar

Re: Disable colored output

2012-02-27 Thread Rob Lally
I'm reasonably sure that with maven you can pass system properties using the form mvn goalname -Dinsert.property.here=true R. On 27 Feb 2012, at 17:54, Vladimir Matveev wrote: > Thank you again, I will try to look harder for it. > > On Feb 27, 5:46 pm, Stuart Sierra wrote: >> Sorry,

Re: Reload/Reimport Java Class

2011-08-27 Thread Rob Lally
There's a good chance that JavaRebel would let you do what you want: http://www.zeroturnaround.com/jrebel/ Rob. On 27 Aug 2011, at 15:41, Asim Jalis wrote: > Is there a way to reimport a Java class into the REPL? > > This would be very useful in dynamically developing Java code from

Is there a reason that def- isn't part of the core lib?

2011-09-17 Thread Rob Lally
Hi all, Whilst trying to minimise the visible surface areas of namespaces, I've often felt the need for a def- function/macro that marks a def'ed var with :private metadata. An analog of defn-, if you will. Is there a reason that I shouldn't do this or a reason that it doesn't seem to be a mem

Re: Is there a reason that def- isn't part of the core lib?

2011-09-18 Thread Rob Lally
is with functions, and therefore more need for > marking functions meant only for internal use as such (but that is > just guessing at other peoples' thought processes). > > [1] > http://groups.google.com/group/clojure/browse_thread/thread/80d873ef625221ac/243a0ad490150d3e?lnk=gs

Re: Is there a reason that def- isn't part of the core lib?

2011-09-18 Thread Rob Lally
> I think probably the reason against it is that generally there is not >>> as much reason to use a constant, for example, outside of its >>> namespace as there is with functions, and therefore more need for >>> marking functions meant only for internal use as such (but th

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread Rob Lally
Would supporting other data structures make it slower when using vectors, or only when using non-vector seq's? If it makes it substantially slower across the board, personally I'd still like core.match to support all of clojure's built in data structures; but I could understand why people would