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
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,
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
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
= (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
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])
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
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
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
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
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
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]
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
13 matches
Mail list logo