Re: Critiques of my-flatten which uses CPS

2014-07-18 Thread Mark Phillips
I *think* I've found the answer to my own question... In this post... https://groups.google.com/forum/#!topic/clojure/Cuk_bJrIq-Y I found this link (I changed the line number)... https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2589 And if the

Re: Future of performant software: cores or memory?

2014-07-18 Thread Mark Phillips
Hi Gary, I wrote my initial post in January, but I just wanted to say... Thanks for taking the time to write your reply - I very much appreciated it. I suspect I will be writing algorithms in C++ for a while to come, but at some point I hope to do comparisons with Clojure versions. Regards,

Re: Critiques of my-flatten which uses CPS

2014-07-18 Thread Mark Engelberg
Yeah, you've answered your own question. In practice, I doubt the difference is measurable. Another common idiom you see in Clojure code is: (defn f [xs] (if-let [s (seq xs)] ...do something with (first s) and (f (rest s))... ...base case...)) This ensures that you seq-ify the input

Re: Critiques of my-flatten which uses CPS

2014-07-18 Thread Mark Phillips
Thanks - useful idioms to know about! On Friday, 18 July 2014 16:18:33 UTC+9:30, puzzler wrote: Yeah, you've answered your own question. In practice, I doubt the difference is measurable. Another common idiom you see in Clojure code is: (defn f [xs] (if-let [s (seq xs)] ...do

unexpected behavior of clojure.core/empty

2014-07-18 Thread Brian Craft
= (empty [:foo 5]) [] = (first (mapv identity {:foo 5})) [:foo 5] = (empty (first (mapv identity {:foo 5}))) nil What just happened there? Is this expected? In the second and third cases the type of the vector is clojure.lang.MapEntry, which I expect is the root of the behavior, but this seems

Re: unexpected behavior of clojure.core/empty

2014-07-18 Thread Bob Hutchison
On Jul 18, 2014, at 5:45 AM, Brian Craft craft.br...@gmail.com wrote: = (empty [:foo 5]) [] = (first (mapv identity {:foo 5})) [:foo 5] = (empty (first (mapv identity {:foo 5}))) nil = (class (first (mapv identity {:foo 5}))) clojure.lang.MapEntry = (class (first (mapv (fn [[k v]] [k v])

Re: unexpected behavior of clojure.core/empty

2014-07-18 Thread Mike Fikes
My guess: Perhaps this is a bug, or alternatively, a known issue that won't be addressed because to do so would be a breaking change. There is an old demo of Clojure given by Rich where MapEntry's were printed using some sort of un-readable notation #:foo 5. But clearly MapEntry's have been

Re: unexpected behavior of clojure.core/empty

2014-07-18 Thread Neel Upadhyaya
While MapEntry is displayed as a vector it isn't actually a collection (which is a mistake I sometimes make also), so empty behaves as expected. On Friday, 18 July 2014 10:45:19 UTC+1, Brian Craft wrote: = (empty [:foo 5]) [] = (first (mapv identity {:foo 5})) [:foo 5] = (empty (first

Re: Calculating the number of timestamps logged within a specific time period

2014-07-18 Thread John Gabriele
On Thursday, July 17, 2014 8:49:12 AM UTC-4, empt...@gmail.com wrote: Hi, I have a list of epoch times which map to HTTP requests. '(1405060202611 1405060201157 1405060201361 1405060201261 1405060200391 1405060201458 1405060201705 1405060201058 1405060205062 1405060201558

Re: Calculating the number of timestamps logged within a specific time period

2014-07-18 Thread Mike Fikes
You could use frequencies: user= (frequencies (map #(quot % 1000) epochs)) {1405060202 1, 1405060201 8, 1405060200 1, 1405060205 1} -- 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

Rxtx Serial Dependency issues with ARM processor

2014-07-18 Thread Samuel Nelson
We are trying to include a serial port handler package in our project. We tried to use the rxtx22 1.0.6 clojar... this works on laptops but not on the smaller computer with an ARM processor. we tried following the instructions here: (except we are using the localrepo plugin for lein to manage

Re: Rxtx Serial Dependency issues with ARM processor

2014-07-18 Thread Jozef Wagner
Hi, AFAIK RXTX is obsolete, you may have more luck with JSSC [1]. Including it in your Clojure project is easy, just add [org.scream3r/jssc 2.8.0] While it's not perfect, its pretty solid from my experience. There is a support for ARM, but I've been using it only in x86-64 Linux. [1]

Re: unexpected behavior of clojure.core/empty

2014-07-18 Thread Brian Craft
hm, looks even more broken in the context of these examples. On Friday, July 18, 2014 5:04:34 AM UTC-7, Mike Fikes wrote: My guess: Perhaps this is a bug, or alternatively, a known issue that won't be addressed because to do so would be a breaking change. There is an old demo of Clojure