Re: sorted-map-by sample call

2009-06-21 Thread kkw
Hi Steve, I didn't know the difference between a keyfn and a comparator. Thanks for pointing that out! Kev On Jun 22, 3:50 pm, "Stephen C. Gilardi" wrote: > On Jun 22, 2009, at 1:23 AM, kkw wrote: > > >    I had some fortune with the sorted-by function: > > > 1:11 user=> (sort-by (fn [e] (

Re: sorted-map-by sample call

2009-06-21 Thread Stephen C. Gilardi
On Jun 22, 2009, at 1:23 AM, kkw wrote: I had some fortune with the sorted-by function: 1:11 user=> (sort-by (fn [e] (second e)) [[1 99] [3 4] [5 6] [7 8]]) ([3 4] [5 6] [7 8] [1 99]) You were using the form of sort-by that accepts a "keyfn", not the one where you also provide a compara

sorted-map-by sample call

2009-06-21 Thread kkw
Hi folks, I had some fortune with the sorted-by function: 1:11 user=> (sort-by (fn [e] (second e)) [[1 99] [3 4] [5 6] [7 8]]) ([3 4] [5 6] [7 8] [1 99]) so I thought I'd have a go with sorted-map-by also: 1:13 user=> (doc sorted-map-by) - clojure.core/sorted-ma

Re: passing clojure functions into a java program.

2009-06-21 Thread Stephen C. Gilardi
On Jun 22, 2009, at 12:29 AM, timshawn wrote: It's trying to find:cascading$cascading_function__44$fn__46 When I look in my target directory/exploded jar, it has this cascading$cascading_function__38$fn__40.class Could there be a "classes" directory that's in the classpath of the repl, but

Re: passing clojure functions into a java program.

2009-06-21 Thread timshawn
Hi Stephen, Thanks for the note. Yea that first post was kind of unwieldy. hadoop-function takes in f and data, and does some preprocessing before applying f to the processed data. (I tried it by just using f directly and taking hadoop-function out, and same thing happens) One of the problems th

Re: Question/Problem re (set! *warn-on-reflection* true)

2009-06-21 Thread Stephen C. Gilardi
On Jun 21, 2009, at 11:17 PM, arasoft wrote: When I enter the following function into the REPL it compiles and works without problems: (defn harmonic-number [n prec] (reduce + (map #(with-precision prec (/ 1 (bigdec %))) (range 1 (inc n ) After (set! *warn-on-reflection* true), in

Re: passing clojure functions into a java program.

2009-06-21 Thread Stephen C. Gilardi
On Jun 21, 2009, at 11:07 PM, timshawn wrote: I can't seem to figure out why java can't find the clojure class in the following example, where f is a clojure function (defn cascading-function [f] (proxy [BaseOperation Function] [(Integer. 1) (Fields. (into-array Comparable ["line"]))]

Question/Problem re (set! *warn-on-reflection* true)

2009-06-21 Thread arasoft
When I enter the following function into the REPL it compiles and works without problems: (defn harmonic-number [n prec] (reduce + (map #(with-precision prec (/ 1 (bigdec %))) (range 1 (inc n ) After (set! *warn-on-reflection* true), in a normal REPL I get: Reflection warning, NO_SO

Re: jar handling

2009-06-21 Thread Christopher Wilson
In Java 6 you can do a wildcard for jar files in a directory: java -cp /opt/jars/*:. clojure.main this will find all the jar files in /opt/jars/ and put them on the classpath. On Sun, Jun 21, 2009 at 9:10 PM, Wilson MacGyver wrote: > > Hi, > > Does clojure have any way to handle jar loading wit

passing clojure functions into a java program.

2009-06-21 Thread timshawn
I can't seem to figure out why java can't find the clojure class in the following example, where f is a clojure function (defn cascading-function [f] (proxy [BaseOperation Function] [(Integer. 1) (Fields. (into-array Comparable ["line"]))] (operate [flowProcess functionCall] (let

Re: javafx

2009-06-21 Thread Pinocchio
CuppoJava wrote: > I'm still not very clear about what JavaFX actually is and what's its > relation to Java. Do you know of any links that explain it clearly? > Its basically a way of declaring Swing GUI items and their layout. One of its cool features is that it allows "binding" code to chang

jar handling

2009-06-21 Thread Wilson MacGyver
Hi, Does clojure have any way to handle jar loading without having to specify it in command line? I'm looking for something like groovy, where if you place a jar file in ~/.groovy/lib. it's available to any groovy code. Thanks -- Omnem crede diem tibi diluxisse supremum. --~--~-~--~-

Re: Incanter classpath difficulties

2009-06-21 Thread liebke
Hi Anand, Try changing the INCANTER_HOME variable in the clj script to the absolute path to the incanter directory, instead of a relative path, like ./ or ../ Let me know if that doesn't work. David On Jun 21, 1:19 pm, Anand Patil wrote: > On Sun, Jun 21, 2009 at 5:51 PM, carlitos wrote:

Re: problems with regex

2009-06-21 Thread Stephen C. Gilardi
On Jun 21, 2009, at 4:34 PM, Alpinweis wrote: I am trying some regex in Clojure and I have problems using regex literals. Don't know why the following doesn't seem to work: user=> (re-seq #"\\W+" "the quick brown fox") () user=> (re-seq #"\\w+" "the quick brown fox") () user=> (re-seq #"\\s"

problems with regex

2009-06-21 Thread Alpinweis
I am trying some regex in Clojure and I have problems using regex literals. Don't know why the following doesn't seem to work: user=> (re-seq #"\\W+" "the quick brown fox") () user=> (re-seq #"\\w+" "the quick brown fox") () user=> (re-seq #"\\s" "the quick brown fox") () user=> (re-seq #"\\S"

clojure loader script

2009-06-21 Thread mccraigmccraig
here's a ruby script which configures a java classpath against a bunch of clojure projects and starts clojure http://github.com/mccraigmccraig/clojure-load.rb e.g. clojure -l clojure-json -l clojure-http-client -l clojureql - it assumes it's repo is in the same dir as the clojure repo and

Re: Incanter classpath difficulties

2009-06-21 Thread Anand Patil
On Sun, Jun 21, 2009 at 5:51 PM, carlitos wrote: > > On Jun 21, 5:01 pm, Anand Patil > wrote: > > Hi David and all, > > > > Just trying to get up and running with Incanter, on a Mac with the github > > head. The clj script doesn't find part of parallel colt: > > > > (head-mac bin) ./clj > > Cloj

Re: Incanter classpath difficulties

2009-06-21 Thread carlitos
In my previou message I wrote > I can reproduce the issues you report where I meant to say > I _can't_ reproduce the issues you report Sorry for the noise. Carlos --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "C

Re: Incanter classpath difficulties

2009-06-21 Thread carlitos
On Jun 21, 5:01 pm, Anand Patil wrote: > Hi David and all, > > Just trying to get up and running with Incanter, on a Mac with the github > head. The clj script doesn't find part of parallel colt: > > (head-mac bin) ./clj > Clojure 1.1.0-alpha-SNAPSHOT Hello, I think the script is intended to be

Incanter classpath difficulties

2009-06-21 Thread Anand Patil
Hi David and all, Just trying to get up and running with Incanter, on a Mac with the github head. The clj script doesn't find part of parallel colt: (head-mac bin) ./clj Clojure 1.1.0-alpha-SNAPSHOT user=> (use '(incanter core)) java.lang.NoClassDefFoundError: cern/colt/matrix/tdouble/impl/DenseC

Re: Why different behaviour?

2009-06-21 Thread Stephen C. Gilardi
On Jun 21, 2009, at 9:51 AM, Ratandeep Ratti wrote: Why are these different? user> #^String "hello" ; Evaluation aborted. #^ is a reader macro for applying metadata to the next object read. The metadata applied is always a map. If a sequence of characters () appears after #^: #^, it is i

Why different behaviour?

2009-06-21 Thread Ratandeep Ratti
Why are these different? user> #^String "hello" ; Evaluation aborted. (def a "hello") #'user/a user> #^String a "hello" --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: Clojure in "Computing in Science and Engineering"

2009-06-21 Thread Jon Harrop
On Sunday 21 June 2009 08:55:54 Anand Patil wrote: > Sounds similar to ForkJoin, which Rich pointed out to me a while ago: > http://www.ibm.com/developerworks/java/library/j-jtp11137.html Yes. I believe the main difference is that the TPL does not block because there is no "join" operation. --

Re: Clojure in "Computing in Science and Engineering"

2009-06-21 Thread Jon Harrop
On Sunday 21 June 2009 02:44:02 Kyle Schaffrick wrote: > On Sat, 20 Jun 2009 11:29:44 +0100 > Jon Harrop wrote: > > The Task Parallel Library. It uses concurrent wait-free work-stealing > > queues to provide an efficient implementation of "work items" than > > can spawn other work items with auto

Re: Clojure in "Computing in Science and Engineering"

2009-06-21 Thread Anand Patil
On Sat, Jun 20, 2009 at 11:29 AM, Jon Harrop wrote: > > The Task Parallel Library. It uses concurrent wait-free work-stealing > queues > to provide an efficient implementation of "work items" than can spawn other > work items with automatic load balancing on shared memory machines. Cilk > uses >