Correct place to put human understandable tests

2010-10-04 Thread sebastien
I write a search application, and to test it I need some util functions such as "test-search" to run and see the result. I.e. this function cannot be created as unit test - there's just no one correct answer, and only human can understand it. So, test directory is not the place to put such function

Re: AOT compilation and calling Clojure from Java

2010-08-16 Thread sebastien
Yes, it helped! Thank you! To make the story complete I put here complete code: semantic/hello.clj: (ns semantic.hello (:gen-class :name semantic.hello :methods [[sayhello [] void] [sayhello_arg [String] void]])) (defn -sayhello [this] (println "Hello from Clojure!"))

Re: AOT compilation and calling Clojure from Java

2010-08-15 Thread sebastien
I tried to compile hello.clj with "lein compile" and with "(compile 'semantic.hello)", and also with old versions of clojure.jar and clojure.contrib.jar (current one is 1.2-beta1), but it all gave the same result. -- You received this message because you are subscribed to the Google Groups "Cloju

Re: AOT compilation and calling Clojure from Java

2010-08-15 Thread sebastien
> Can you run: > javap YourClass.class > and give us the result? Here it is: public class semantic.hello extends java.lang.Object { public static {}; public semantic.hello(); public java.lang.Object clone(); public int hashCode(); public java.lang.String toString();

Re: AOT compilation and calling Clojure from Java

2010-08-15 Thread sebastien
Hi Meikel, Unfortunetly it doesn't work, pointing to h.hello() and saying "cannot find symbol". ^ Same with my Eclipse, which says that import "semantic" cannot be resolved, though both package and class are in the bin (classes) directory.

AOT compilation and calling Clojure from Java

2010-08-15 Thread sebastien
I understand that after AOT compilation Clojure namespaces and functions became completely normal Java classes and can be called from any Java code, is it correct? If so, how will look like this call? For example, I have clojure module: (ns semantic.hello (:gen-class)) (defn -sayhello [] (print

Re: Generation of random sequences

2009-08-25 Thread sebastien
On Aug 25, 7:26 pm, Christophe Grand wrote: > no, distinct uses a hash-set (nearly-constant lookup) so distinct is O(n). Oh, that's great, i will use it. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Generation of random sequences

2009-08-25 Thread sebastien
> The simplest I can think of is: > (defn make-random-numbers [dim max] >   (take dim (distinct (repeatedly #(rand-int max) But distinct itself gives order of growth O(n!), through it scans resulting list for every generated number, isn't it? --~--~-~--~~~---~--~-

Generation of random sequences

2009-08-25 Thread sebastien
What is the most efficient way to generate list of unique random numbers? The function must look something like this: (defn make-random-numbers [dim max] ) where dim is dimensionality of the vector, and max is the upper bound of random numbers. The problem is not to allow duplicates in th