Re: fastest aget and aset

2009-09-28 Thread Jonathan Smith
On Sep 27, 9:17 am, Timothy Pratley timothyprat...@gmail.com 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

Re: Mocking?

2009-09-28 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

Re: fastest aget and aset

2009-09-28 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,

Pattern matching library

2009-09-28 Thread Antonio Garrote
Hello everyone. I¹ve been working for a couple of days in a small library for doing pattern matching in Clojure. Although it is just a sketch, is currently working. These are some examples of how to use: (tuples/match (a b (c d) e) (1 2 (3 4) 5) (+ b e)) 7 (def

Re: Mocking?

2009-09-28 Thread C. Florian Ebeling
In Java I'd just have an interface with two implementations, and bootstrap the tests with a different implementation, in clojure I guess I'd do something like: (in-ns `some.thing) (defn foo [] nil) or something? That would consitute a root binding because of the 'defn, but you need a

Re: Mocking?

2009-09-28 Thread Mark Derricutt
That doesn't to work for me here: (defn disable-bulletin [f] (info Mocking out Bulletin Connect SMS API) (binding [com.jobsheet.util.bulletin/send-sms (fn [a b] (info Sending mock SMS))] (f))) (use-fixtures :once disable-bulletin) I even tried declaring the disable-bulletin

Re: how to understand macro in clojure?

2009-09-28 Thread Michael Wood
Hi 2009/9/26 gerryx...@gmail.com gerryx...@gmail.com: (defn float2 [f a b]  (f (float a ) (float b))) (float2 + 1 2) = 3.0 (defmacro mfloat2 [f a b]  (f (float a) (float b))) (mfloat2 + 1 2 ) = 2.0  ???   macro expend to last expression in list,right? This is because (mfloat2 + 1 2)

Re: how to understand macro in clojure?

2009-09-28 Thread Jarkko Oranen
On Sep 28, 12:13 pm, Michael Wood esiot...@gmail.com wrote: Hi 2009/9/26 gerryx...@gmail.com gerryx...@gmail.com: (defn float2 [f a b]  (f (float a ) (float b))) (float2 + 1 2) = 3.0 (defmacro mfloat2 [f a b]  (f (float a) (float b))) (mfloat2 + 1 2 ) = 2.0  ???   macro

Re: fastest aget and aset

2009-09-28 Thread Christophe Grand
Hi Timothy, On Sun, Sep 27, 2009 at 3:17 PM, Timothy Pratley timothyprat...@gmail.comwrote: Now for 1d arrays, the index also cannot be anything other than an integer, so we could do the same thing [just added (int ~i)]: {:inline (fn [a i] `(. clojure.lang.RT (aget ~a (int ~i (time

Re: Mocking?

2009-09-28 Thread Stuart Sierra
On Sep 27, 9:18 pm, John Harrop jharrop...@gmail.com wrote: Isn't (binding [foo bar] ...) already such a mechanism? Or does the fixtures feature let you specify such a binding for a whole group of tests obviating the need to repeat the binding form in multiple test functions, Yes. A fixture

two way mirrors in trial room

2009-09-28 Thread ashi raheel
This site is specially designed for those people who feel tired while surfing internet or during work on internet. You can enjoy your time here. Hope you all like and send your best comments to update site. http://itstime2enjoy.blogspot.com/2009/08/beware-of-two-way-mirrors-in-trial.html

Re: question on last page of Conjure tutorial

2009-09-28 Thread Matt
Try: code (deftest test-add (add { :controller controller-name :action add })) /code Let me know if that works. In the tutorial, I guess I should be more clear on what to change. -Matt Courtney On Sep 27, 9:50 am, Warren warrenthomasw...@yahoo.com wrote: I worked through the Conjure

Re: Mocking?

2009-09-28 Thread Laurent PETIT
2009/9/28 C. Florian Ebeling florian.ebel...@gmail.com In Java I'd just have an interface with two implementations, and bootstrap the tests with a different implementation, in clojure I guess I'd do something like: (in-ns `some.thing) (defn foo [] nil) or something? That would

An exception when updating to the latest version of Clojure and Clojure Contrib.

2009-09-28 Thread Matt
Hi all, I'm trying to update Conjure to use the latest versions of Clojure and Clojure Contrib. I've cloned both repositories and built locally. After adding the jar files to my local copy of Conjure, I get the following exception: [java] Exception in thread main

Re: Mocking?

2009-09-28 Thread Matt Clark
This is exactly the sort of purpose I wrote c.c.mock for. It is essentially a glorified binding, but it should fit the bill. (expect [sms-func (times once (has-args [message recipient]))] (code-under-test)) This can tie into clojure.test as well if you are using that. On Sep 28, 3:50 am,

Re: An exception when updating to the latest version of Clojure and Clojure Contrib.

2009-09-28 Thread Meikel Brandmeyer
Hi, I got this error, because a jar with an old clojure (or was it contrib?) version was lingering in the classpath. Removing the jar fixed the problem. Maybe you should check this also. Sincerely Meikel --~--~-~--~~~---~--~~ You received this message because

ClojureCLR installation?

2009-09-28 Thread Sean Devlin
Hey guys, I recently found a need to use the CLR. As such, I've got some general questions about ClojureCLR 1. Is there a ClojureCLRBox or anything similar? 2. Does anyone know of some good articles about the differences between the two platforms? Will contrib behave differently? E.g.

Re: An exception when updating to the latest version of Clojure and Clojure Contrib.

2009-09-28 Thread Matt
Thanks, I'll try it out. However, that's a bad sign, and may mean I'll have to wait until the libraries are updated before I move to the new version of Clojure. :( On Sep 28, 9:32 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, I got this error, because a jar with an old clojure (or was it

Re: An exception when updating to the latest version of Clojure and Clojure Contrib.

2009-09-28 Thread Meikel Brandmeyer
Hi, IIRC, it was a breaking change with 1.0 and should only show up in AOT compiled code. Sincerely Meikel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: ClojureCLR installation?

2009-09-28 Thread Shawn Hoover
On Mon, Sep 28, 2009 at 9:58 AM, Sean Devlin francoisdev...@gmail.comwrote: Hey guys, I recently found a need to use the CLR. As such, I've got some general questions about ClojureCLR 1. Is there a ClojureCLRBox or anything similar? No, just the instructions on the github wiki. 2.

Re: Adding Classpaths On The Fly

2009-09-28 Thread Roman Roelofsen
Hi, I am currently working on a Clojure / OSGi integration: www.ogeesource.org The goal is to extend Clojure with a module-like runtime, not to fully convert Clojure and Clojure-based applications to OSGi (which would be quite hard anyway). So far you can add new modules at runtime and

Converting sequences into function parameters

2009-09-28 Thread Paul Henning
I keep running into the situation where I would call functions of the form (fn [ rest] ...) with data that I have built up in a sequence, and can't figure out how to do it. My current instance of this is wanting to call clojure.contrib.combinatorics/cartesian-product on a list of lists of

Re: Converting sequences into function parameters

2009-09-28 Thread psf
Sorry... apply works just fine. On Sep 28, 9:04 am, Paul Henning p...@cybermesa.com wrote: I keep running into the situation where I would call functions of the form (fn [ rest] ...) with data that I have built up in a sequence, and can't figure out how to do it.  My current instance of this

2 upcoming NYC talks

2009-09-28 Thread Stuart Sierra
Hi folks, I'm doing two talks about Clojure and Hadoop, one at Hadoop World NYC on Friday, October 2, and the other at the NoSQL meetup on Monday, October 5. Details, links, and follow-ups at http://stuartsierra.com/ -SS --~--~-~--~~~---~--~~ You received this

Re: fastest aget and aset

2009-09-28 Thread Timothy Pratley
Thanks Jon and Christophe for your insights! Very interesting :) --~--~-~--~~~---~--~~ 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