Re: Manifold streams/deferreds raising errors downstream of a sink

2015-08-09 Thread Atamert Ölçgen
Hi Andy, I would provide a function that wraps put!. It would still return a deferred, but not the result of put!. It would create a deferred, representing the result of the computation and pass it down the stream together with the input. Consumers would set its value once the computation is done.

Manifold streams/deferreds raising errors downstream of a sink

2015-08-09 Thread Andy Chambers
Hey All, I'm trying to build a library that exposes manifold streams for data producing applications. The intention would be for these apps to s/put! to a sink stream returned by the producer function. However, I need to take the value that is put in and pipe it into some other function before I

Re: The following behavior of into function is a bug or the intended result?

2015-08-09 Thread Justin Smith
PersistentArrayMap is automatically promoted to PersistentHashMap when it reaches a specific size. This is done for performance reasons. Neither collection is considered ordered, and you should use a different datatype if you want ordered data. On Sunday, August 9, 2015 at 6:31:20 PM UTC-7, Phi

Re: Is the following behavior of into function a bug or the intended result?

2015-08-09 Thread Andy Fingerhut
array-map preserving order is a property of its implementation, but not a promise to those who use them. Adding a key/value pair to an array-map that takes it over a certain threshold size changes its implementation to a hash-map, which in general changes the seq order completely. This is by desi

The following behavior of into function is a bug or the intended result?

2015-08-09 Thread Young Kim
This works well as expected. The order of input elements is maintained. (into (array-map) [[1 :a] [2 :b] [3 :c] [4 :d] [5 :e] [6 :f] [7 :g] [8 :h]]) ; => {1 :a, 2 :b, 3 :c, 4 :d, 5 :e, 6 :f, 7 :g, 8 :h} However, as soon as the number of the input elements exceeds 9, the order is not maintained a

Check out this set of Clojure Book Reviews.

2015-08-09 Thread Akram Ahmad
To do my bit to spread the Clojure meme, I've put together the essence of the finest resources in print that have helped me grok Clojure. I take a look at the following (Clojure, and related) books, in turn: 1. *The Joy of Clojure*, Second edition (Manning), by Michael Fogus and Chris Hou

Is the following behavior of into function a bug or the intended result?

2015-08-09 Thread Young Kim
This works well as excepted. The order of input elements is maintained. (into (array-map) [[1 :a] [2 :b] [3 :c] [4 :d] [5 :e] [6 :f] [7 :g] [8 :h]]) ; => {1 :a, 2 :b, 3 :c, 4 :d, 5 :e, 6 :f, 7 :g, 8 :h} However, as soon as the number of the input elements exceeds 9, the order is not maintained a

Re: why does this file watcher keep triggering?

2015-08-09 Thread Lawrence Krubner
Okay, I am an idiot. I had the "directory watch" setup to watch the directory where the uberjar was built, so of course it was triggered thousands of time while the uberjar was built, since I guess every new byte added to the uberjar triggers the change event. So I set my app to listen on the

some guidance sought

2015-08-09 Thread William la Forge
I've done a lot with AA trees in the past, creating variations that are immutable, durable (replacing b-trees) and versioned of vectors, maps and sets. I would like to migrate these ideas from Java to Clojure, while implementing the interfaces appropriate for Clojure. Still being very much a n

Re: (fail promise exception)

2015-08-09 Thread William la Forge
Agent2 release 0.2.1 now wraps exceptions passed as values in a vector marked with the metadata flag :wrapped. The request-call method can now distinguish between exceptions thrown by a request (and rethrows them) and exceptions used as responses (and unwraps them before returning them). https:

Re: why does this file watcher keep triggering?

2015-08-09 Thread Lawrence Krubner
Let's assume for a moment that, for some strange reason, the "directory watching" strategy won't work here. Does anyone have any other suggestions? I am thinking there must be a simple way to setup Jenkins and Supervisord to run these apps, but what I'm doing keeps getting more and more complex

Re: What does Zach Tellman mean by "factored out for greater inlining joy"

2015-08-09 Thread Lawrence Krubner
Reid, thank you. I think you answer half the question. You make a good point about giving the JVM a way to better optimize a hot path. I think you are right about that. But, given the large amount of repetition between "chain'-" and "chain-" I'm wondering why this wasn't done with a macro?

Re: Parsing Unicode character with Clojure

2015-08-09 Thread Andy Fingerhut
Oh, and whether or not Java regular expressions let you specify ranges of such characters outside the BMP, I have no idea. I would expect there to be odd behavior in that area of Java's regular expression implementation, but haven't done extensive testing myself to find out. I would recommend tha

Re: Parsing Unicode character with Clojure

2015-08-09 Thread Andy Fingerhut
Java uses UTF-16 encoding in memory for String objects. Characters in the Basic Multilingual Plane are represented as a single 16-bit character in memory, but anything outside the BMP is represented as a sequence of 2 16-bit characters. Clojure's \u syntax can only be used to directly represent a

Parsing Unicode character with Clojure

2015-08-09 Thread 良ϖ
I've come on some trouble when parsing an Unicode character with Clojure. I know it's likely to be a problem related to Java and not Clojure itself but I'm looking for a Clojurish solution so that's why I'm posting it here. FYI, I have a GNU / Linux OS on the top on which I use emacs 24 in cunjunct

[ANN] Leiningen 2.5.2

2015-08-09 Thread Jean Niklas L'orange
Hello fellow hackers, I am happy to finally announce the release of Leiningen 2.5.2, which I know a lot of you have been waiting for. This version is mainly a bugfix release, but there are also some new enhancements to the `new` command. To all the Cider users out there, nREPL has also been upda

Treat macro as function at compile time

2015-08-09 Thread Isaac Zeng
(defmacro foo [] `(list (defmacro ~'bar [] "nice") (defn ~'bar-fn [] (~'bar (foo) ;; => (#'defcrud.core/bar #'defcrud.core/bar-fn) (bar-fn) ArityException Wrong number of args (0) passed to: core/eval8800/bar--8801 clojure.lang.AFn.throwArity (AFn.java:429) but this working (def