Transducers: sequence versus eduction

2015-04-01 Thread Tassilo Horn
Hi all, I've switched many nested filter/map/mapcat applications in my code to using transducers. That brought a moderate speedup in certain cases and the deeper the nesting has been before, the clearer the transducers code is in comparison, so yay! :-) However, I'm still quite unsure about the

Re: Transducers: sequence versus eduction

2015-04-01 Thread vvedee
Eduction retains the ability to be recomposed with other transducers higher in the function chain. The following two are nearly equivalent: (transduce (take 1e2) + (eduction (filter odd?) (range))) (transduce (comp (filter odd?) (take 1e2)) + (range)) This will be slower: (transduce (take 1e2) +

Re: Transducers: sequence versus eduction

2015-04-01 Thread Tassilo Horn
vve...@gmail.com writes: > Eduction retains the ability to be recomposed with other transducers > higher in the function chain. The following two are nearly equivalent: > > (transduce (take 1e2) + (eduction (filter odd?) (range))) > (transduce (comp (filter odd?) (take 1e2)) + (range)) > > This wi

Re: clojure, not the go to for data science

2015-04-01 Thread Sayth Renshaw
Sorry no offense intended, I have prelude, cider and Nrepl going right now. Actually I haven't usually gotten along with emacs but it is just working at the moment and um i like it. I am just changing flx-ido to vertical as it looks a little nicer but that's it really, the only change. O

Re: clojure, not the go to for data science

2015-04-01 Thread Sayth Renshaw
I saw all the changes to incanter. lot of breaking changes going into version 2 but they seem to reduce dependencies and going to core.matrix as you pointed out. There are a lot of things in clojure that I have found that I just haven't heard about need to clean some web data there are severa

Re: clojure, not the go to for data science

2015-04-01 Thread Joseph Guhlin
I haven't tested 1.9 or 2.0 yet, but I'm working with an existing project that depends in incanter and I don't think there is a return on investment for updating it at this time (only using a few features). If I was starting now, I would go with 1.9 for my data analysis. --Joseph On Tuesday, M

Re: clojure, not the go to for data science

2015-04-01 Thread Joseph Guhlin
I haven't been able to get quil working with gorilla repl yet, but I hope the support is there one day. --Joseph On Wednesday, April 1, 2015 at 5:37:05 AM UTC-5, Sayth Renshaw wrote: > > I saw all the changes to incanter. lot of breaking changes going into > version 2 but they seem to reduce de

Re: Transducers: sequence versus eduction

2015-04-01 Thread Alex Miller
First, I love this discussion! Great questions, great thinking. Up top, I wanted to mention a couple things that have changed in alpha6: - Eduction is no longer Seqable and thus the return from eduction is not seqable (but it is reducible and iterable). You can use iterator-seq to get a chunked

Re: Transducers: sequence versus eduction

2015-04-01 Thread Alex Miller
The general idea is that eduction is best when the result will be completely consumed in a reducible context. Any case of reusing the result will likely be better served by sequence which can cache and reuse the answer. On Wednesday, April 1, 2015 at 3:51:53 AM UTC-5, Tassilo Horn wrote: > > vv

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alex Miller
If this is a use case that could be lifted out into an API level function, that would be an ok enhancement jira request to consider (would need to think about it more, but that seems like one option). On Tuesday, March 31, 2015 at 6:12:09 PM UTC-5, puzzler wrote: > > The reason instaparse uses C

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alexander Gunnarson
This patch is incredibly useful! Great job to everyone that contributed. One question: how do I enable conditional reading by default in the REPL as opposed to passing a properties map to /read-string/, etc.? Do I set certain system properties in the command line like "cond_read=true"? On Tuesd

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alex Miller
If you want to invoke the reader programmatically with reader conditionals allowed, you can do that through the (new) options map available with both read and read-string: user=> (read-string {:read-cond :allow} "#?(:clj foo :cljs bar)") foo There is no way to "turn on" read conditionals by def

Re: Debugging in CIDER

2015-04-01 Thread MOY
Nice work !!! On Sunday, March 29, 2015 at 1:46:33 AM UTC+8, Bozhidar Batsov wrote: > > Hey everyone, > > Just wanted to let you know that the most requested feature for CIDER (a > debugger, in case you're wondering) has just landed in the master branch ( > https://github.com/clojure-emacs/cider/

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Sean Corfield
On Apr 1, 2015, at 10:09 AM, Alex Miller wrote: > There is no way to "turn on" read conditionals by default at the REPL - it is > only on by default when loading a .cljc file. This sounds like a useful feature to add to the REPL tho’ so that you can copy’n’paste code as-is and have it behave "a

Re: Transducers: sequence versus eduction

2015-04-01 Thread Tassilo Horn
Alex Miller writes: Hi Alex, > - Eduction is no longer Seqable and thus the return from eduction is not > seqable (but it is reducible and iterable). You can use iterator-seq to get a > chunked seq over the top if you need one. Really? user> *clojure-version* {:major 1, :minor 7, :incremental

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alex Miller
REPLs are of course free to choose how they read and some of the other changes coming out of the socket repl work may make those choices easier to select. The clojure.main/repl function is already (perhaps excessively) parameterized and can be given a custom read function for example. The read and

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alexander Gunnarson
@Alex Miller: Thanks for letting me know. I'll unfortunately have to change my workflow accordingly. On Tuesday, March 31, 2015 at 10:51:13 AM UTC-6, Alex Miller wrote: > > Clojure 1.7.0-alpha6 is now available. > > Try it via > - Download: > https://repo1.maven.org/maven2/org/clojure/clojure/1

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alexander Gunnarson
@Sean Corfield — That's exactly my point. I use Sublime Text and I usually just copy-paste code from various buffers / open files into a REPL buffer on my workspace. Maybe that's not the most efficient way, and I want to move to some sort of auto-reload plugin for leiningen a la figwheel for Cl

Re: Transducers: sequence versus eduction

2015-04-01 Thread Alex Miller
On Wed, Apr 1, 2015 at 2:17 PM, Tassilo Horn wrote: > Alex Miller writes: > > Hi Alex, > > > - Eduction is no longer Seqable and thus the return from eduction is not > > seqable (but it is reducible and iterable). You can use iterator-seq to > get a > > chunked seq over the top if you need one.

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alex Miller
We'll consider it, thanks for the questions. On Wednesday, April 1, 2015 at 2:32:58 PM UTC-5, Alexander Gunnarson wrote: > > @Sean Corfield — That's exactly my point. I use Sublime Text and I usually > just copy-paste code from various buffers / open files into a REPL buffer > on my workspace. M

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alexander Gunnarson
@Alex Miller — Thanks! I appreciate it. On Tuesday, March 31, 2015 at 10:51:13 AM UTC-6, Alex Miller wrote: > > Clojure 1.7.0-alpha6 is now available. > > Try it via > - Download: > https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha6/ > - Leiningen: [org.clojure/clojure "1.7.0-alpha6"

Re: Transducers: sequence versus eduction

2015-04-01 Thread Tassilo Horn
Alex Miller writes: > > seqable (but it is reducible and iterable). You can use > > iterator-seq to get a chunked seq over the top if you need one. > > Really? > > user> *clojure-version* > {:major 1, :minor 7, :incremental 0, :qualifier "alpha6"} > user> (seq (eduction (m

Re: Transducers: sequence versus eduction

2015-04-01 Thread Alex Miller
On Wed, Apr 1, 2015 at 3:17 PM, Tassilo Horn wrote: > Alex Miller writes: > > Ok. But to me, if I can call `seq` on a thing and iterate it using > `first` and `rest`, that's a sequable thing to me. :-) > Fair enough. I just meant it no longer implements Seqable. :) > > > The general idea

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
Hi, Iterate calls its function after it is finished iterating. ;; clojure 1.6 user=> (take 2 (iterate zero? 0)) (0 true) ;; clojure 1.7-alpha6 user=> (take 2 (iterate zero? 0)) ClassCastException java.lang.Boolean cannot be cast to java.lang.Number clojure.lang.Numbers.isZero (Numbers.java:92)

Re: [ANN] Phoenix 0.1.0 - help with structuring & configuring Component-based systems

2015-04-01 Thread Fluid Dynamics
On Tuesday, March 31, 2015 at 7:49:52 AM UTC-4, Jeroen van Dijk wrote: > > Thanks for sharing James! I'll have a look. > > As a side note, I see in the example code that you are dissoc-ing on the > component. This can lead to unexpected behaviour as I have > experienced (mostly in repl cases), a

Re: clojure, not the go to for data science

2015-04-01 Thread Fluid Dynamics
On Tuesday, March 31, 2015 at 8:45:31 AM UTC-4, Phillip Lord wrote: > > The benefit is that Emacs is that its not constantly changing, and it > gives you some stability over the years. I like latex, for instance, for > the same reason. I can still access a 10 year old document and use it. > Firs

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Matching Socks
Ambrose, does that "iterate" result arise from chunking? "iterate" is advertised as producing an infinite lazy sequence. While a suddenly chunking "iterate" will no doubt smoke out some cases like this, doesn't it seem that they are abuses? It's not quite spot-on to employ "take" or "take-wh

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
AFAICT there is consistently one extra call, which seems to suggest an off-by-one error in the IReduce implementation of Iterate. ;; 1.6 user=> (take 11 (iterate (fn [a] (prn (str "PR" a)) (inc a)) 1)) "PR1" "PR2" "PR3" "PR4" "PR5" "PR6" "PR7" "PR8" "PR9" "PR10" (1 2 3 4 5 6 7 8 9 10 ...) ;; 1.7.

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
Actually it seems the oddity is that "next" now does the computation instead of "first" in Iterate.java. On Wed, Apr 1, 2015 at 8:56 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > AFAICT there is consistently one extra call, which seems to suggest an > off-by-one error in t

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alex Miller
I would love a jira for the iterate thIng. -- 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 moderated - please be patient with your first post. To unsub

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
Ok. On Wed, Apr 1, 2015 at 9:10 PM, Alex Miller wrote: > I would love a jira for the iterate thIng. > > -- > 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 mem

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
http://dev.clojure.org/jira/browse/CLJ-1692 On Wed, Apr 1, 2015 at 9:12 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Ok. > > On Wed, Apr 1, 2015 at 9:10 PM, Alex Miller wrote: > >> I would love a jira for the iterate thIng. >> >> -- >> You received this message because y

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Alex Miller
Thanks! If anyone wants to throw a patch, would love to have one. Must include test ... On Wednesday, April 1, 2015 at 8:14:52 PM UTC-5, Ambrose Bonnaire-Sergeant wrote: > > http://dev.clojure.org/jira/browse/CLJ-1692 > > On Wed, Apr 1, 2015 at 9:12 PM, Ambrose Bonnaire-Sergeant < > abonnair...@

Re: clojure, not the go to for data science

2015-04-01 Thread Rinu Boney
Hi, I'm working on a machine learning library for Clojure - Clatern( https://github.com/rinuboney/clatern). I've written a couple of blog posts in my blog rinuboney.github.io. I've just begun and there is lot more work to do. I've actually submitted a Google summer of code proposal and I ho

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
Here's some weird behaviour I found from 1.6. user=> (take 1 (iterate zero? true)) (true) user=> (reduce (fn [l _] (reduced l)) (iterate zero? true)) ClassCastException java.lang.Boolean cannot be cast to java.lang.Number clojure.lang.Numbers.isZero (Numbers.java:90) Is this a bug, and should th