Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Herwig Hochleitner
On my repl into is consistently faster. What versions of clojure, java and the OS are you running? -- 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 members are

Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Satoru Logic
Hi, I'm using Clojure1.4.0, Java1.6 on MacOS. user= (clojure-version) 1.4.0 ~ satoru$ java -version java version 1.6.0_35 Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) On Sunday, November 4, 2012

Re: impossible to create classes for non-closure environment

2012-11-04 Thread Vladimir Tsichevski
Thank you Stephen, the problem is that it is impossible to create create a Java class using closure with the following characteristics: 1) all methods must match given Java signature. For example, if I need a method public String getSomeString(); all I get is public Object getSomeString();

Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Marko Kocić
I get big fluctuation in results for bot naive-into and into, ranging from 400ms to 1500ms. This is probably because of the GC kicking in and influencing timings. Changing timings to something like: (System/gc) (time (do (into #{} (range 1e6)) nil)) and (System/gc) (time (do (naive-into #{}

Seems like bug in clojure-1.4.0

2012-11-04 Thread ru
ru@ru-maclin:~/ProtegeClojureOMTabs-1.5/lib_ext$ java -jar clojure-1.4.0.jar Clojure 1.4.0 user= (read-string 07) 7 user= (read-string 09) NumberFormatException Invalid number: 09 clojure.lang.LispReader.readNumber (LispReader.java:253) user= (read-string 08) NumberFormatException Invalid

Re: Seems like bug in clojure-1.4.0

2012-11-04 Thread ru
Thank you, Bronsa! Sincerely, Ru воскресенье, 4 ноября 2012 г., 14:27:30 UTC+4 пользователь Bronsa написал: Number prefixed by 0 are read by the clojure reader as octals. So the decimal 8 is 010 2012/11/4 ru sor...@oogis.ru javascript: ru@ru-maclin:~/ProtegeClojureOMTabs-1.5/lib_ext$

Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Satoru Logic
On Sunday, November 4, 2012 6:20:37 PM UTC+8, Marko Kocić wrote: I get big fluctuation in results for bot naive-into and into, ranging from 400ms to 1500ms. This is probably because of the GC kicking in and influencing timings. Changing timings to something like: (System/gc) (time (do

Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Marko Kocić
On Sunday, November 4, 2012 11:41:23 AM UTC+1, Satoru Logic wrote: On Sunday, November 4, 2012 6:20:37 PM UTC+8, Marko Kocić wrote: I get big fluctuation in results for bot naive-into and into, ranging from 400ms to 1500ms. This is probably because of the GC kicking in and influencing

Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Satoru Logic
BTW, I can't even reproduce the examples here: http://clojure.org/Transients#toc5 On Sunday, November 4, 2012 6:49:50 PM UTC+8, Marko Kocić wrote: On Sunday, November 4, 2012 11:41:23 AM UTC+1, Satoru Logic wrote: On Sunday, November 4, 2012 6:20:37 PM UTC+8, Marko Kocić wrote: I get

Re: Proposal/request: Give clojure.core/conj a unary implementation

2012-11-04 Thread Jonathan Fischer Friberg
It would be nice if clojure.core/conj had a unary implementation ([coll] coll) I support this. Reasons: 1. It makes sense, adding nothing to something should give back the something. 2. It's consistent with disj as mentioned. 3. Supporting edge cases like this can make some algorithms

Java-to-Clojure source translation?

2012-11-04 Thread Vladimir Tsichevski
Hi gurus, I wonder if there are any means that'd help me translate Java sources to Clojure? I do not expect getting working Closure code OOTB, just anything to start from. Regards, Vladimir -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Java-to-Clojure source translation?

2012-11-04 Thread Maik Schünemann
Why do you want this? If you have java code you can just call it from clojure.no need for translation Am 04.11.2012 19:39 schrieb Vladimir Tsichevski tsichev...@gmail.com: Hi gurus, I wonder if there are any means that'd help me translate Java sources to Clojure? I do not expect getting

Re: Java-to-Clojure source translation?

2012-11-04 Thread Vladimir Tsichevski
Hi Maik, no, I need to re-implement existing code in Clojure. Why do you want this? If you have java code you can just call it from clojure.no need for translation Am 04.11.2012 19:39 schrieb Vladimir Tsichevski tsich...@gmail.comjavascript: : Hi gurus, I wonder if there are any means

Re: Java-to-Clojure source translation?

2012-11-04 Thread Maik Schünemann
A direct translation is often not a good idea because java uses so much mutable stateand this is really not idiomatic in clojure.but it will be a helpful experience to make the java code to functional clojure code. IMO calling java code from clojure is better as a direct translation with all that

Re: Proposal/request: Give clojure.core/conj a unary implementation

2012-11-04 Thread Jean Niklas L'orange
On Sunday, November 4, 2012 12:43:22 AM UTC+1, Ben wrote: There might be a reason to write (apply f coll seqable) in a situation in which f might be conj, though. One may use (reduce f coll seqable) instead, if that makes sense semantically in that context. -- You received this message

Re: impossible to create classes for non-closure environment

2012-11-04 Thread Stuart Sierra
Hello, Clojure (by the way, it is not spelled closure) is not really designed to generate pure-Java classes. `gen-class` is slightly more flexible than `deftype`, but it will still generate references to Clojure classes. If the structure of your Java classes is defined by interfaces, `deftype`

pattern-matching in Closure?

2012-11-04 Thread Vladimir Tsichevski
Hi gurus. Is it possible in Clojure to use pattern matching, like I can with Bigloo scheme, for example: (match-case '(a b a) ((?x ?x) 'foo) ((?x ?- ?x) 'bar)) Regards, Vladimir -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Java-to-Clojure source translation?

2012-11-04 Thread Stuart Sierra
Hello, It is not really possible to make a direct translation from Java to Clojure. Java has mutable variables and imperative flow-control, for which there is no equivalent in Clojure. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: pattern-matching in Closure?

2012-11-04 Thread Moritz Ulrich
Use core.match: https://github.com/clojure/core.match On Sun, Nov 4, 2012 at 10:09 PM, Vladimir Tsichevski tsichev...@gmail.com wrote: Hi gurus. Is it possible in Clojure to use pattern matching, like I can with Bigloo scheme, for example: (match-case '(a b a) ((?x ?x) 'foo) ((?x ?-

Re: Java-to-Clojure source translation?

2012-11-04 Thread Vladimir Tsichevski
Hi Stuart. On Monday, November 5, 2012 1:10:36 AM UTC+4, Stuart Sierra wrote: Hello, It is not really possible to make a direct translation from Java to Clojure. Java has mutable variables and imperative flow-control, for which there is no equivalent in Clojure. -S That's why I'm

Re: pattern-matching in Closure?

2012-11-04 Thread Vladimir Tsichevski
Hi Moritz, this looks promising. Do you know where can I get any documentation/examples for this module? Regards, Vladimir On Monday, November 5, 2012 1:10:59 AM UTC+4, Moritz Ulrich wrote: Use core.match: https://github.com/clojure/core.match On Sun, Nov 4, 2012 at 10:09 PM, Vladimir

Re: Java-to-Clojure source translation?

2012-11-04 Thread Stephen Compall
On Sun, 2012-11-04 at 13:18 -0800, Vladimir Tsichevski wrote: That's why I'm looking for means which could HELP me rewrite my code base to Clojure, not to produce compilable and runnable code. Just parse Java syntax tree and pretty-print it back as Clojure-like text. I think the thesis of this

Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Marek Šrank
These are my results using (dotimes (time (dotimes ...))) combo to get consistent results: - on sets: (dotimes [i 10] (time (dotimes [j 100] (into #{} (range 1e4) Elapsed time: 388.595226 msecs Elapsed time: 406.666801 msecs Elapsed time: 421.559753 msecs Elapsed time: 444.719263 msecs

Re: pattern-matching in Closure?

2012-11-04 Thread Marek Šrank
At the wiki: https://github.com/clojure/core.match/wiki :-) Marek. On Sunday, November 4, 2012 11:03:40 PM UTC+1, Vladimir Tsichevski wrote: Hi Moritz, this looks promising. Do you know where can I get any documentation/examples for this module? Regards, Vladimir On Monday, November

Re: pattern-matching in Closure?

2012-11-04 Thread Vladimir Tsichevski
Excellent! Thanks! On Monday, November 5, 2012 2:12:16 AM UTC+4, Marek Šrank wrote: At the wiki: https://github.com/clojure/core.match/wiki :-) Marek. On Sunday, November 4, 2012 11:03:40 PM UTC+1, Vladimir Tsichevski wrote: Hi Moritz, this looks promising. Do you know where can I get

Re: Java-to-Clojure source translation?

2012-11-04 Thread Andy Fingerhut
On Nov 4, 2012, at 1:10 PM, Stuart Sierra wrote: Hello, It is not really possible to make a direct translation from Java to Clojure. Java has mutable variables and imperative flow-control, for which there is no equivalent in Clojure. -S First, some suggestions that are not

Re: Proposal/request: Give clojure.core/conj a unary implementation

2012-11-04 Thread Andy Fingerhut
I created CLJ-1103 and attached a patch that makes this change, as well as related changes to conj! assoc assoc! and dissoc! (dissoc, disj and disj! already handled these cases). http://dev.clojure.org/jira/browse/CLJ-1103 Andy On Nov 4, 2012, at 5:52 AM, Jonathan Fischer Friberg wrote: It

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-11-04 Thread Dominic Cerisano
Well darn it. Had a detailed response ready to go and found that GG does not save drafts. POS. Movin on. The upshot was I tried predicting tick data (see attachment) with a model pretty much identical to the one given here with little real success. It would only resolve if I removed all of the

Re: Why is a non-transient `into` faster than the built-in one?

2012-11-04 Thread Satoru Logic
I can get more consistent results when running the examples in Ubuntu. On Monday, November 5, 2012 6:09:25 AM UTC+8, Marek Šrank wrote: These are my results using (dotimes (time (dotimes ...))) combo to get consistent results: - on sets: (dotimes [i 10] (time (dotimes [j 100] (into #{}

Re: Playing with clojure-encog, Machine-Learning wrapper

2012-11-04 Thread Timothy Washington
That's just the thing - I'm not using the encog 3rd party library. I wrote *github.com/twashing/nn* completely from scratch. I did have the idea that maybe bid, ask and volume were not enough data with which to make reliable predictions. So I'll also try adding 3, 5, and 7 tick running averages

unseq

2012-11-04 Thread cej38
Say you are given a vector A=[a1 a2 a3 a4] by some function/library/Java call/whatever. You want to use A in some function F that expects the values a1 a2 a3 a4 but not in the form of A; for example (defn F [w x y z] (+ w x y z)). Is there some function G that you can use on A such that (F (G

lein-ritz Swank character coding

2012-11-04 Thread Matthew Phillips
Hello, my current lein-ritz (0.5.0) setup, started with slime-connect, hangs when handling Unicode characters, e.g. user (def a \uD83D\uDE1F) ; UTF-16 representation of Unicode 4 WORRIED FACE #'clojure.core/a user a ? The REPL is hung at this point: in the the mini buffer I see error in