Re: Reactive Patterns with Atoms - am I using too much state?

2013-12-01 Thread Sam Ritchie
Okay, got it. It looks like you're using agents where I'd been using atoms. Not sure if there's much of a difference for these use cases... the one-directional flow of source -> state -> watcher update notification -> ui change seems to work well with both agents and atoms. Brian Marick wrote:

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Korny Sietsma
Whereas the Joy of Clojure makes me think of a certain '70s book with interesting illustrations, that I used to stealthily read in the back shelves of the local library as a teen. The Joy of Clojure is an awesome book. Though part of me wishes it had at least one '70s style line drawing of Rich in

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Alex Miller
Every time I see this topic subject I can't help but think that "joy if clojure" is true. (assert (if 'clojure 'joy)) On Saturday, November 30, 2013 5:21:21 AM UTC-6, J. Pablo Fernández wrote: > > Hello, > > I have a copy of The Joy of Clojure that I bought a couple of years ago. > Is it still

Re: [ANN] Slamhound 1.5.0 + screencast + Vim plugin

2013-12-01 Thread guns
On Sun 1 Dec 2013 at 02:31:54PM -0800, Patrick Kristiansen wrote: > Great work! Thank you for the compliment :). Slamhound is a great tool, so I hope I can convince more people to try it out. > Regarding the screencast: I would be very interested to hear about > your Clojure development setup wi

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Mars0i
+1 for the promo code. Thanks. Manning got at least one new direct customer. On Sunday, December 1, 2013 2:55:06 AM UTC-6, Michael Klishin wrote: > > 2013/12/1 Sean Corfield > > >> +1 for Manning's MEAP approach - I've bought most of my Manning books >> through the early access program over the

Re: Clojure for the Brave and True, an online book for beginners

2013-12-01 Thread Paddy Gallagher
Daniel, I've just finished reading this series and thought it was superb. The Emacs chapters in particular were a massive help. I'm a complete newbie with Emacs and the detail here was pitched just perfectly. It got me exactly what I needed to start to become productive very quickly. I highly

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Paddy Gallagher
I've read Daniel's series 'Clojure for the Brave and True' and I highly recommend it as a resource both for the excellent content/philosophy and humour :) It personally made the Clojure introductory learning experience a very enjoyable one. Thanks Daniel. cheers Paddy On Sunday, December 1,

Re: I need a vector not a list?

2013-12-01 Thread James Reeves
Seqs in Clojure are very much like iterators in other languages. They're an abstraction for navigating a sequential data structure. Also because values in Clojure are immutable, you rarely, if at all, encounter situations where those objects need to be copied. Why would you, when you can just refe

Re: [ANN] Slamhound 1.5.0 + screencast + Vim plugin

2013-12-01 Thread Patrick Kristiansen
Great work! Regarding the screencast: I would be very interested to hear about your Clojure development setup with Vim, especially the plugins and configuration you are using. I see you are using some sort of split view with Vim on top and a REPL at the bottom. Is that GNU screen split in two

Re: Any elegant solutions for this problem?

2013-12-01 Thread Ryan
Nice James, I like it :) Ryan On Sunday, December 1, 2013 10:02:32 PM UTC+2, James Reeves wrote: > > There's also: > > (->> xs > (partition-by string?) > (partition 2) > (mapcat (fn [[[s] xs]] (for [x xs] [s x] > > > - James > > > On 1 December 2013 19:39, Ryan > wrote: > >> Ha

Re: I need a vector not a list?

2013-12-01 Thread Andy Smith
Can a seq be thought of as a kind of a list of pointers to the original vector elements then? If so, then does an operation on a vector, (e.g. reverse), cause clojure to internally generate a seq of pointers to the original vector elements? In other words seqs seem to provide a layer of indirec

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Daniel Higginbotham
I've been working on a book for beginners, "Clojure for the Brave and True" http://www.braveclojure.com/ Thanks, Daniel On Saturday, November 30, 2013 6:21:21 AM UTC-5, J. Pablo Fernández wrote: > > Hello, > > I have a copy of The Joy of Clojure that I bought a couple of years ago. > Is it stil

Re: I need a vector not a list?

2013-12-01 Thread Andy Smith
Interesting alternatives. (vec) makes a vector out of a collection, so this is meant to be faster than (apply vector)? Also how does (into []) differ from (vec) in terms of what it does and its performance? On Saturday, 30 November 2013 21:48:10 UTC, Kelker Ryan wrote: > > Vectors are mostly fo

Re: Any elegant solutions for this problem?

2013-12-01 Thread James Reeves
There's also: (->> xs (partition-by string?) (partition 2) (mapcat (fn [[[s] xs]] (for [x xs] [s x] - James On 1 December 2013 19:39, Ryan wrote: > Haha, no worries, it happens :) > > That seems to work nice as well! > > Ryan > > > On Sunday, December 1, 2013 9:36:47 PM UT

Re: Any elegant solutions for this problem?

2013-12-01 Thread Ryan
Haha, no worries, it happens :) That seems to work nice as well! Ryan On Sunday, December 1, 2013 9:36:47 PM UTC+2, john walker wrote: > > I swear english is my first language. This one isn't elegant, but at least > you know you aren't alone: > > (->> ["foo" 1 "bar" 10 20 "clown" 5] > (par

Re: Any elegant solutions for this problem?

2013-12-01 Thread Ryan
Thanks both for your answers. @Ben, that seems to do it. I was trying to make it a bit "nicer" but failed @john, that was my original approach but it does not produce what I want. The result of that is (("foo" 1) ("bar" 10 20) ("clown" 5)) but I need (("foo" 1) ("bar" 10) ("bar" 20) ("clow

Re: Any elegant solutions for this problem?

2013-12-01 Thread john walker
I swear english is my first language. This one isn't elegant, but at least you know you aren't alone: (->> ["foo" 1 "bar" 10 20 "clown" 5] (partition-by string?) (partition 2) (map #(apply concat %)) (map #(let [x (first %)] (for [y (rest %)] [x y])

Re: Any elegant solutions for this problem?

2013-12-01 Thread john walker
Use partition-by http://clojuredocs.org/clojure_core/clojure.core/partition-by On Sunday, December 1, 2013 1:57:52 PM UTC-5, Ryan wrote: > > Hi all, > > I have a vector which contains an unknown number of repetitions of the > following pattern: > > String, followed by 1 or more integers > > For

Re: Any elegant solutions for this problem?

2013-12-01 Thread john walker
Sorry, I spoke without seeing that you were aware of partition-by. Here's one that isn't vectorized. (def v ["foo" 1 "bar" 10 20 "clown" 5]) (->> v (partition-by string?) (partition 2) (map #(apply concat %))) On Sunday, December 1, 2013 2:10:04 PM UTC-5, Ben wrote: > > user=> (def v

Re: Any elegant solutions for this problem?

2013-12-01 Thread Ben Wolfson
user=> (def v ["foo" 1 "bar" 2 3 "baz" 4]) #'user/v user=> (first (reduce (fn [[res s] e] (if (string? e) [res e] [(conj res [s e]) s])) [[] nil] v)) [["foo" 1] ["bar" 2] ["bar" 3] ["baz" 4]] On Sun, Dec 1, 2013 at 10:57 AM, Ryan wrote: > Hi all, > > I have a vector which contains an unknown num

Any elegant solutions for this problem?

2013-12-01 Thread Ryan
Hi all, I have a vector which contains an unknown number of repetitions of the following pattern: String, followed by 1 or more integers For example: String Integer String Integer Integer String Integer Integer Integer String Integer What I am trying to do is to create a vector of pairs which

Re: [ANN] Slamhound 1.5.0 + screencast + Vim plugin

2013-12-01 Thread guns
On Sun 1 Dec 2013 at 01:24:15AM -0800, Ruslan Prokopchuk wrote: > Does it work with ClojureScript? If yes, how should I process? I'm sorry to say it does not. However, as the CLJS compiler is more accessible than the Clojure compiler, I imagine CLJS would be the first candidate for a hypothetica

Re: exporting imported symbols

2013-12-01 Thread Dave Tenny
OK. If it were supported, I'd still be able to tell where the symbol came from, it would just feature an indirection, right? On Sun, Dec 1, 2013 at 10:58 AM, Stuart Sierra wrote: > Not supported. This is a feature. As long as you use `:require :as` or > `:require :refer`, you can always tell wh

Re: exporting imported symbols

2013-12-01 Thread Stuart Sierra
Not supported. This is a feature. As long as you use `:require :as` or `:require :refer`, you can always tell where a symbol comes from. -S On Sunday, December 1, 2013 10:10:46 AM UTC-5, Dave Tenny wrote: > > (ns mine >(:use foo)) ; has public symbol bar > > What is the proper use/require/r

exporting imported symbols

2013-12-01 Thread Dave Tenny
(ns mine (:use foo)) ; has public symbol bar What is the proper use/require/refer entry to export foo's bar as mine's bar without defining a new public bar in mine? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Geraldo Lopes de Souza
Michael, Thank you for promotion code. Regards, Geraldo On Sunday, December 1, 2013 6:55:06 AM UTC-2, Michael Klishin wrote: > > 2013/12/1 Sean Corfield > > >> +1 for Manning's MEAP approach - I've bought most of my Manning books >> through the early access program over the years. >> > > BTW,

Re: Suggestions for state modification improvements in this bit of code?

2013-12-01 Thread Dave Tenny
Wow, lots of good tips, thanks.I'm still digesting some of the finer bits. Observations: - The refheap pastebin link was useful for future code posts. - The :pre/:post conditions pointer was good, I vaguely new of them, but hadn't used them. - The as-> form was new (and useful) to me. In gen

Re: core.async and performance

2013-12-01 Thread Mathias Picker
Did you look into Pulsar https://github.com/puniverse/pulsar ? I'm using core.async in the browser, but I don't see it as a multithreading mechanism. Pulsar puts an erlang-like api around the quasar lightweight threads and actors for java. Looks really nice, and seems a good fit for dse type a

Re: [ANN] Slamhound 1.5.0 + screencast + Vim plugin

2013-12-01 Thread Ruslan Prokopchuk
Does it work with ClojureScript? If yes, how should I process? Anyway, thanks for the great tool! On Saturday, November 30, 2013 6:14:36 AM UTC+2, guns wrote: > > Hello, > > I am happy to announce version 1.5.0 of Slamhound, technomancy's amazing > ns rewriting tool. > > ;; ~/.lein/profile

Re: Is The Joy if Clojure up to date?

2013-12-01 Thread Michael Klishin
2013/12/1 Sean Corfield > +1 for Manning's MEAP approach - I've bought most of my Manning books > through the early access program over the years. > BTW, The Joy of Clojure 2nd ed. MEAP is 50% off today (Dec 1st) with the code *dotd1201cc* according to a Manning promo. -- MK http://github.com