Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-09 Thread julianrz
This may be a little off topic, but does this, or any other framework, solve some testing inconveniences that exist in Clojure and probably other functional languages: 1) testing recursive functions. I want to test what a recursion STEP does, not the whole function. Can I mock 'recur'? 2) testin

Re: exception in 'map' mutates result to nil -- bug?

2012-12-02 Thread julianrz
Hmm.. I think you are raising both a technical and a philosophical issue - what exactly should a higher-order function return when some application of the supplied function throws exception... The behaviors could be: 1) throw 2) return null 3) return an empty collection (do not continue after 1st

lambda function returning a constant?

2011-09-06 Thread julianrz
Hello All, I am new to Clojure. Surprised why this code does not work: user=> (filter #(%) [1 2 3]) ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn Here my intent behind #(%) is to define a lambda function returning its argument. Since Clojure defines truth on any type, it sh

Re: lambda function returning a constant?

2011-09-06 Thread julianrz
but all literature seems to go into #() really fast, so it will be stumbled upon by novices Julian On Sep 6, 12:44 pm, Laurent PETIT wrote: > 2011/9/4 julianrz > > > Hello All, > > I am new to Clojure. Surprised why this code does not work: > > > user=> (filter #(%