Re: soft question: should remote channels appear like local channels

2014-02-01 Thread t x
I agree, besides potential connection loss, I no longer see the distinction between local async channel and remote async channel. Thanks to everyone for clarifications / help. On Fri, Jan 31, 2014 at 6:51 PM, Sean Corfield s...@corfield.org wrote: I like that way of thinking, Timothy! Thomas:

(async/map identity []) blocks

2014-02-01 Thread Phlex
async/map is supposed to close its output channel when one of the channels in the collection signals that it is closed. I had assumed that it would do the same when the collection is empty, but it blocks (i witnessed that on clojurescript) Now it's easy to work around that but not very nice to

Re: soft question: should remote channels appear like local channels

2014-02-01 Thread Thomas Heller
I guess the comparison to dropping-buffer is fair, but remember that disconnects are actually quite more common than usually expected (esp. on mobile). So plan on dropping messages and test accordingly, but remember most messages will originate from something the user did on the client. Its

data-readers, spyscope

2014-02-01 Thread Dave Tenny
Java 1.7.0.45 Lein 2.3.4 Clojure 1.5.1 I'm trying to use https://github.com/dgrnbrg/spyscope and have put the documented bits in my ~/.lein/profiles.clj but cannot get it to work. {:user {:dependencies [... [spyscope 0.1.4] ...] :injections [(require 'spyscope.core)

dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Ambrose Bonnaire-Sergeant
Hi, If you're interested in refactoring out instances of (zipmap (keys m) (vals m)), then dynalint 0.1.2 may help. [com.ambrosebs/dynalint 0.1.2] I've added a simplistic case that warns if a clojure.lang.APersistentMap$KeysSeq or ValsSeq is passed to zipmap. user= (require '[dynalint.lint :as

Re: dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Sam Ritchie
I added this to the :injections vector of my lein project; it looks really helpful, but when compiling in emacs via nRepl, without the line number, it's really hard to track down these errors. Is there any way that dynalint could (optionally) output more info about where the infraction takes

Re: dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Ambrose Bonnaire-Sergeant
Hi Sam, Are you familiar of dynalint.lint/print-warning? That's really the best idea I've come up with. Thanks, Ambrose On Sat, Feb 1, 2014 at 9:54 PM, Sam Ritchie sritchi...@gmail.com wrote: I added this to the :injections vector of my lein project; it looks really helpful, but when

Re: dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Sam Ritchie
Let me see how I can work that into the flow. Thanks! Ambrose Bonnaire-Sergeant mailto:abonnaireserge...@gmail.com February 1, 2014 6:58 AM Hi Sam, Are you familiar of dynalint.lint/print-warning? That's really the best idea I've come up with. Thanks, Ambrose -- You received this message

Re: dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Ambrose Bonnaire-Sergeant
I just realised it's undocumented. (print-warning) prints the latest warning. (print-warning id) prints the dynalint warning with the corresponding id (print-warning id depth) also has depth like clojure.repl/pst. Ditto with print-error. Thanks, Ambrose On Sat, Feb 1, 2014 at 10:14 PM, Sam

Re: dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Sam Ritchie
Thanks for the help! This is great. Ambrose Bonnaire-Sergeant mailto:abonnaireserge...@gmail.com February 1, 2014 7:16 AM I just realised it's undocumented. (print-warning) prints the latest warning. (print-warning id) prints the dynalint warning with the corresponding id (print-warning id

Re: dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Sam Ritchie
ah, nice. Yeah, that should work. Ambrose Bonnaire-Sergeant mailto:abonnaireserge...@gmail.com February 1, 2014 7:16 AM I just realised it's undocumented. (print-warning) prints the latest warning. (print-warning id) prints the dynalint warning with the corresponding id (print-warning id

Re: dynalint, lein-dynalint 0.1.2 - Warn on (zipmap (keys m) (vals m))

2014-02-01 Thread Ambrose Bonnaire-Sergeant
For those playing along, it seems (= m (zipmap (keys m) (vals m))) *is* a valid property to rely on. http://dev.clojure.org/jira/browse/CLJ-1302?focusedCommentId=33627page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-33627 Thanks, Ambrose On Sat, Feb 1, 2014 at

Re: order of returned values from keys and vals

2014-02-01 Thread Sam Ritchie
Looks like Rich just chimed in with: keys order == vals order == seq order Matching Socks mailto:phill.w...@gmail.com January 31, 2014 7:31 PM Actually, http://dev.clojure.org/jira/browse/CLJ-1302 keys and vals consistency not mentioned in docstring was declined, with the comment The

Re: [ANN] clj-refactor.el 0.10.0

2014-02-01 Thread adrians
Really cool stuff, guys. Are you considering a Light Table version as well? -- 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

Re: [ANN] clj-refactor.el 0.10.0

2014-02-01 Thread Alex Baranosky
adrians, Personally, for my part in clj-refactor.el, I don't have any interest in porting it to Light Table. The project depends pretty heavily on other Emacs packages such as paredit, multiple-cursors, and yas-snippets, so it's not trivial to port. On Sat, Feb 1, 2014 at 11:22 AM, adrians

Re: [ANN] clj-refactor.el 0.10.0

2014-02-01 Thread Magnar Sveen
Sorry, mate. It's not about cornering the market in clojure refactorings - it's just scratching our own itch, and hopefully other people find it useful too. I'm a little surprised Light Table doesn't offer these things already. Isn't it a Clojure-centric editor? On Saturday, February 1, 2014

Re: data-readers, spyscope

2014-02-01 Thread dgrnbrg
I have reproduced your issue--it is very strange, as on some of my machines spyscope works, and others, it fails the same as it does for you. This makes me think I am inadvertently relying on an unknown implementation detail. I have now observed that even when spyscope gets loaded into

Re: order of returned values from keys and vals

2014-02-01 Thread Justin Smith
Realistically, how many situations are there where running keys and vals independently is preferable to running seq once and using the two element vectors that returns? Usually this way one can avoid walking the whole thing twice. (into {} (map (fn [[k v]] [k (inc v)]) {:a 0 :b 1})) is

Re: order of returned values from keys and vals

2014-02-01 Thread Ambrose Bonnaire-Sergeant
zipmap could also potentially use transients (which would be a nice addition). keys/vals are also lazy, so I would be surprised if there was any performance difference with walking the seq twice. Thanks, Ambrose On Sun, Feb 2, 2014 at 11:35 AM, Justin Smith noisesm...@gmail.com wrote:

Re: order of returned values from keys and vals

2014-02-01 Thread Michał Marczyk
On 2 February 2014 04:54, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: zipmap could also potentially use transients (which would be a nice addition). My patch for this has been waiting in JIRA since end of May 2012: http://dev.clojure.org/jira/browse/CLJ-1005 Cheers, Michał

Re: order of returned values from keys and vals

2014-02-01 Thread Justin Smith
user (class (keys {:a 0 :b 1})) clojure.lang.APersistentMap$KeySeq Are you sure PersistentMap$KeySeq is lazy? I don't really get how a lazy sequence over an associative would work in Clojure (at least as clojure exists now). Pardon my ignorance but if this is producing a lazy result, how is it

Re: order of returned values from keys and vals

2014-02-01 Thread Michał Marczyk
On 2 February 2014 05:14, Justin Smith noisesm...@gmail.com wrote: Pardon my ignorance but if this is producing a lazy result, how is it doing so? https://github.com/clojure/clojure/blob/dff9600387b962f16fc78e6477e10e34651fd366/src/jvm/clojure/lang/APersistentMap.java#L134 APersistentMap's

Re: order of returned values from keys and vals

2014-02-01 Thread Ambrose Bonnaire-Sergeant
Thanks Michał, voted. Ambrose On Sun, Feb 2, 2014 at 12:13 PM, Michał Marczyk michal.marc...@gmail.comwrote: On 2 February 2014 04:54, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: zipmap could also potentially use transients (which would be a nice addition). My patch

Re: order of returned values from keys and vals

2014-02-01 Thread Ambrose Bonnaire-Sergeant
It also might help to notice KeySeq defines first/next, but never explicitly walks the seq. That's left to the user of the KeySeq. Thanks, Ambrose On Sun, Feb 2, 2014 at 12:18 PM, Michał Marczyk michal.marc...@gmail.comwrote: On 2 February 2014 05:14, Justin Smith noisesm...@gmail.com wrote:

Re: order of returned values from keys and vals

2014-02-01 Thread Chouser
There's no substitute for measurement. (defn maptest [f] (let [m (apply hash-map (range 40))] (time (dotimes [_ 10] (f m))) (f m))) (maptest #(zipmap (keys %) (map inc (vals % ; Elapsed time: 1405.890766 msecs ;= {0 2, 32 34, 2 4, 34 36, 4 6, 36 38, 6 8, 38 40, 8 10, 10 12, 12

Re: order of returned values from keys and vals

2014-02-01 Thread Michał Marczyk
That doesn't mean that we're not walking the seq twice, however. keys and vals work off of separate calls to seq on the map, which of necessity produce distinct seq objects (otherwise traversing a seq over a map would permanently increase its memory consumption). On 2 February 2014 05:18, Michał

Re: order of returned values from keys and vals

2014-02-01 Thread Justin Smith
Excellent, thanks for the information. I just did a benchmark of zipmap over keys and vals vs. into {} over a map, and despite my intuition, they are actually nearly identical in performance. So if zipmap were using transients zipmap with keys and vals would actually be the better performing

Re: order of returned values from keys and vals

2014-02-01 Thread Michał Marczyk
I'd expect (persistent! (reduce-kv (fn [acc k v] (assoc! acc k (inc v))) (transient {}) input-map)) to be the fastest solution. Cheers, Michał On 2 February 2014 05:30, Justin Smith noisesm...@gmail.com wrote: Excellent, thanks for the information. I just did a benchmark of

Re: order of returned values from keys and vals

2014-02-01 Thread Michał Marczyk
Oh, sorry, for some reason Gmail didn't alert me to some of the recent messages coming in while I was viewing this thread. On 2 February 2014 05:32, Michał Marczyk michal.marc...@gmail.com wrote: I'd expect (persistent! (reduce-kv (fn [acc k v] (assoc! acc k (inc v))) (transient {})

Re: order of returned values from keys and vals

2014-02-01 Thread Justin Smith
In the same repl as the above benchmarks, and yes, this is definitely the best so far. I'll have to remember reduce-kv for future usage. user (crit/bench (persistent! (reduce-kv (fn [acc k v] (assoc! acc k (inc v))) (transient {})

webgl and reagent(cljs wrapper for reactjs)

2014-02-01 Thread Sunil S Nandihalli
Hi Everybody, I am new to web-programming but have done some stuff with clojurescript. Now I was looking add an webgl based canvas to render a cube. I am using reagent https://github.com/holmsand/reagent which is a cljs-wrapper around reactjs. I am unable to decide, due to my inexperience in both