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

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 me

Re: Converting sequences into function parameters

2009-09-28 Thread psf
Sorry... "apply" works just fine. On Sep 28, 9:04 am, Paul Henning 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 is > wanting

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 item

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 therefor

Re: ClojureCLR installation?

2009-09-28 Thread Shawn Hoover
On Mon, Sep 28, 2009 at 9:58 AM, Sean Devlin wrote: > > 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. Does anyone know o

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 clojur

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 wrote: > Hi, > > I got this error, because a jar with an old clojure (or was it > contrib?) ve

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. String

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 you

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, Mar

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" java.lang.NoSuchMethodErr

Re: Mocking?

2009-09-28 Thread Laurent PETIT
2009/9/28 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 roo

Re: question on last page of Conjure tutorial

2009-09-28 Thread Matt
Try: (deftest test-add (add { :controller controller-name :action "add" })) 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 wrote: > I worked through the Conjure tutorial.  Very cool.  On the last page

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: Mocking?

2009-09-28 Thread Stuart Sierra
On Sep 27, 9:18 pm, John Harrop 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 is a function th

Re: fastest aget and aset

2009-09-28 Thread Christophe Grand
Hi Timothy, On Sun, Sep 27, 2009 at 3:17 PM, Timothy Pratley wrote: > 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 (doseq [i (range 100),

Re: how to understand macro in clojure?

2009-09-28 Thread Jarkko Oranen
On Sep 28, 12:13 pm, Michael Wood wrote: > Hi > > 2009/9/26 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 expre

Re: Getting REPL transcript

2009-09-28 Thread Michael Wood
2009/9/26 Emeka : > Sorry, here is the link. > http://gist.github.com/193550 Looks interesting, but I would change login and logout to log-input and log-output to avoid confusion. > On Sat, Sep 26, 2009 at 2:03 PM, Emeka wrote: >> >> Thank you all. Chris Grand has figured it out for me. However

Re: how to understand macro in clojure?

2009-09-28 Thread Michael Wood
Hi 2009/9/26 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) expands t

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 fun

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

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 *