Re: fastest aget and aset

2009-09-27 Thread Jonathan Smith
Thinking about it, this actually happens because of boxing and the relation between macros and functions. If you look at the 1-d case in the original code, it is inlined. In the 2-d case in the original code, it is not inlined. This means that when you coerce the indexs to int in the 2-d code, i

Re: Mocking?

2009-09-27 Thread Mark Derricutt
>From what I've seen of fixtures that just provides setup/teardown functionality (unless I'm mistaken). In my particular instance, I'm wanting to stub out a function defined elsewhere. The function wraps an SMS sending service so I really won't want to get text messages when running tests. In Ja

Re: fastest aget and aset

2009-09-27 Thread Jonathan Smith
On Sep 27, 9:17 am, Timothy Pratley wrote: > As far as I can tell there is currently no way to hint 2d array access > fast > (def a (make-array Double/TYPE 100 100)) > (time (doseq [i (range 100), j (range 100)] (aget a (int i) (int j > "Elapsed time: 836.800335 msecs" > I can't find any comb

Re: Mocking?

2009-09-27 Thread John Harrop
On Sun, Sep 27, 2009 at 8:06 PM, Stuart Sierra wrote: > On Sep 27, 12:55 am, Mark Derricutt wrote: > > How are people handling mocking/stubbing in clojure? Google finds me > some > > old posts about a called? function/macro as part of test-is which looks > like > > it'd do what I need but I can'

SIP servlets library

2009-09-27 Thread Richard Newman
Hi folks, I've just released a supporting library and documentation for an approach I've been using to simplify SIP servlets development. It's on GitHub: http://github.com/rnewman/clj-sip It uses multimethods and hierarchies to reduce the blow-up of dispatching on state and message typ

Re: Mocking?

2009-09-27 Thread Stuart Sierra
On Sep 27, 12:55 am, Mark Derricutt wrote: > How are people handling mocking/stubbing in clojure?  Google finds me some > old posts about a called? function/macro as part of test-is which looks like > it'd do what I need but I can't seem to find any trace of it under > clojure/clojure-contrib tru

Re: Mocking?

2009-09-27 Thread Howard Lewis Ship
I've started a bit of a wrapper around EasyMock as part of Cascade http://github.com/hlship/cascade/blob/master/src/main/clojure/cascade/mock.clj Looks like this in practice: (deftest test-parse-url-query-parameters (with-mocks [request HttpServletRequest] (:train (expect .g

Re: Mocking?

2009-09-27 Thread J. McConnell
On Sun, Sep 27, 2009 at 12:55 AM, Mark Derricutt wrote: > > > How are people handling mocking/stubbing in clojure? > For mocking clojure code, I would have a look at clojure.contrib.mock (1). I haven't used it, but plan to check it out soon. Recently, while doing some performance testing of some

question on last page of Conjure tutorial

2009-09-27 Thread Warren
I worked through the Conjure tutorial. Very cool. On the last page, on the testing framework, I added (deftest test-add (show { :controller controller-name :action "add" })) and when I run tests I get ERROR in (test-add) (test_is.clj:870) Uncaught exception, not in assertion. expected: n

fastest aget and aset

2009-09-27 Thread Timothy Pratley
As far as I can tell there is currently no way to hint 2d array access fast (def a (make-array Double/TYPE 100 100)) (time (doseq [i (range 100), j (range 100)] (aget a (int i) (int j "Elapsed time: 836.800335 msecs" I can't find any combination of type hinting to speed it up. However with a

Re: Adding Classpaths On The Fly

2009-09-27 Thread Volkan YAZICI
For the record, I'm forwarding below reply from Stuart Sierra. On Fri, 25 Sep 2009, Stuart Sierra writes: > On Sep 25, 3:02 am, Volkan YAZICI wrote: >> - (System/setProperty >>"java.class.path" >>(str (System/getProperty "java.class.path") >> ":/tmp/code")) > > The "java.class.p

Re: VimClojure - OpenSolaris - What am I doing wrong?

2009-09-27 Thread Meikel Brandmeyer
Hi, Am 08.09.2009 um 15:31 schrieb Michael Aldred: The NailGun client assumes that the strlen function will handle a null pointer for the argument. Under Solaris this is not the case (http://technopark02.blogspot.com/ 2006/04/solaris-null-pointer-bugs-usrlib00so1.html) Fixed with rev 6fc1bf04

Re: VimClojure on Windows (problem + solution)

2009-09-27 Thread Meikel Brandmeyer
Hi, Am 07.09.2009 um 22:28 schrieb Niels Aan de Brugh: The problem is probably that you have 'shellslash' set. This influences the behavior of the function shellescape(), which is used by VimClojure. Resetting this options fixes the problem. Fixed with rev ea2a3b2e7016. Please give it a try.

Re: "Schema" for data structures

2009-09-27 Thread Miron Brezuleanu
Hi, On Sat, Sep 26, 2009 at 3:36 PM, Daniel Werner wrote: > > On Sep 24, 10:14 am, Miron Brezuleanu wrote: >> about). The degree of typing can be varied (i.e. a person is any map >> with a :name key, or any map with only a :name key, or any map with a >> :name key which is nil or string etc.) >