Re: Error using core.async version of into

2014-05-20 Thread Juan Manuel Gimeno Illa
The problem is that core.async defines some functions which are also defined in clojure.core. When now you invoke into, you are not referring to the clojure.core/into but to cosee.async/into which, if I remember right, takes a channel as first argument. If you want to use the clojure.core

Clojurescript set count returning erroneous values.

2014-05-20 Thread Austin Haas
I'm having trouble isolating a small test case. I call the following code in an update tick: (let [prev' @prev state' @state] (let [rems (clojure.set/difference prev' state') adds (clojure.set/difference state' prev')] (reset! prev state') (assert (= (count rems) (count

Re: in Clojure I rarely find myself reaching for something like the state monad, as I would in Haskell

2014-05-20 Thread Phillip Lord
Julian juliangam...@gmail.com writes: My question is - have other Clojure/Haskell programmers had this experience? (ie I rarely find myself reaching for something like the state monad). I'm interested to hear if so, and why. I find myself reaching for the state monad all the time; then I

Re: Error using core.async version of into

2014-05-20 Thread Craig
Juan, I saw your reply and then noticed the clear warning (...being replaced by: #'clojure.core.async/into) as well. Many thanks for the quick response. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Error using core.async version of into

2014-05-20 Thread Dave Della Costa
The question is why that is happening when you load up the repl--are you using 'use' or 'require' with :refer all on core.async in your p1.core namespace? If so you should probably switch that reference to something like (:require [cljs.core.async :as async]) If this is not what's going on I'm

Re: Error using core.async version of into

2014-05-20 Thread Juan Manuel Gimeno Illa
The repl indicates that current namespace is p1.core p1.core= (into [:a] (list :b :c)) and I imagine in p1.core is where core.async is used or required + referred :all. Juan Manuel El martes, 20 de mayo de 2014 12:48:47 UTC+2, David Della Costa escribió: The question is why that is

Re: A ClojureScript Tutorial For Light Table Users

2014-05-20 Thread Gregg Ramsey
Hi David, This has been very helpful in understanding the internals of the ClojureScript compiler and I found it fascinating. Much appreciated. I am having a bit of trouble understanding the syntax of the user environment map. Is there documentation for this? My goal is to specify multiple

Re: ArithmeticException from unchecked-add

2014-05-20 Thread Greg D
Thanks. I've got to pay more attention to the distinction between long and Long in the documentation. The docs for unchecked-add ( http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/unchecked-add ) only cover the case of both arguments being primitive longs. -- You

Re: Clojurescript set count returning erroneous values.

2014-05-20 Thread David Nolen
Can you demonstrate a complete minimal example? Thanks, David On Tue, May 20, 2014 at 4:06 AM, Austin Haas aus...@pettomato.com wrote: I'm having trouble isolating a small test case. I call the following code in an update tick: (let [prev' @prev state' @state] (let [rems

Re: Joy of Clojure example not working

2014-05-20 Thread Greg D
Yes, the examples in the book are missing some lines. I think the following log shows what they were going for: joy.udp= (remove-method compiler ::osx) joy.udp= (def unix (into unix {::c-compiler /usr/bin/gcc})) joy.udp= (def osx (into osx {:c-compiler gcc})) oy.udp= osx {:home /Users,

debug output with ring and fireplace

2014-05-20 Thread Brian Craft
Running a ring server from vim-fireplace, any errors that occur during request processing will dump to the repl terminal, which is fine. I'd like to add debug output and have it also dump to the repl. However printing to stdout or stderr from a ring handler doesn't work. How can I output to the

Client side tools for Clojure web app (back end questions as well, especially Pedestal)

2014-05-20 Thread Jonathon McKitrick
I'm starting on a new Clojure app, and have been really intrigued by Pedestal. But it seems to present a new conceptual model to get my head around. I'm not sure the benefits would be worth the effort for apps that do not fit the problem Pedestal is trying to solve. That said, I'm open to

Re: Client side tools for Clojure web app (back end questions as well, especially Pedestal)

2014-05-20 Thread Gary Trakhman
Om/Reagent are wrappers over React.js with slightly different approaches, and are the bees-knees. The React.JS rendering approach is a great idea in general, and a great fit for Clojurescript, and discussed elsewhere: http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/ I've

Community Interest in a Clojure Application Config Library, using Zookeeper?

2014-05-20 Thread Thomas Steffes
Hey folks, At Room Key we're using Apache Zookeeper and a home-grown clojure library called drcfg for real-time application configuration management. We're debating open-sourcing drcfg and are trying to gauge community interest in such a tool. We think it's got great usage semantics,

Re: Community Interest in a Clojure Application Config Library, using Zookeeper?

2014-05-20 Thread Jozef Wagner
FYI atoms backed by zookeeper are already provided in Avout library [1]. [1] https://github.com/liebke/avout Jozef On Tue, May 20, 2014 at 11:33 PM, Thomas Steffes smnir...@gmail.com wrote: Hey folks, At Room Key we're using Apache Zookeeper and a home-grown clojure library called drcfg

Re: Community Interest in a Clojure Application Config Library, using Zookeeper?

2014-05-20 Thread Thomas Steffes
RIght - we're familiar with Avout, in fact in the beginning we were using a (very early) version of Avout at Room Key. On Tuesday, May 20, 2014 5:37:32 PM UTC-4, Jozef Wagner wrote: FYI atoms backed by zookeeper are already provided in Avout library [1]. [1]

Count vowels in a string

2014-05-20 Thread Brad Kurtz
I saw a rant online about interviewing developers that mentioned candidates not being able to count the number of vowels in a string. So naturally, I decided to see if I could do it in Clojure! I wanted to see others' opinions on other ways of doing it.

Re: Count vowels in a string

2014-05-20 Thread Mark Engelberg
You're seriously overthinking this if it's any more than a one-liner. (defn count-vowels [s] (count (filter #{\a \e \i \o \u \A \E \I \O \U} (seq s On Tue, May 20, 2014 at 4:03 PM, Brad Kurtz bkurtz@gmail.com wrote: I saw a rant online about interviewing developers that mentioned

Re: Count vowels in a string

2014-05-20 Thread Ben Wolfson
The naïve implementation does sometimes underestimate the total, though. On Tue, May 20, 2014 at 4:13 PM, Mark Engelberg mark.engelb...@gmail.comwrote: You're seriously overthinking this if it's any more than a one-liner. (defn count-vowels [s] (count (filter #{\a \e \i \o \u \A \E \I \O \U}

Re: Count vowels in a string

2014-05-20 Thread Mark Engelberg
Why do you say that? On Tue, May 20, 2014 at 4:16 PM, Ben Wolfson wolf...@gmail.com wrote: The naïve implementation does sometimes underestimate the total, though. On Tue, May 20, 2014 at 4:13 PM, Mark Engelberg mark.engelb...@gmail.comwrote: You're seriously overthinking this if it's

Re: Count vowels in a string

2014-05-20 Thread Ben Wolfson
There are three vowels in naïve, not two. On Tue, May 20, 2014 at 4:19 PM, Mark Engelberg mark.engelb...@gmail.comwrote: Why do you say that? On Tue, May 20, 2014 at 4:16 PM, Ben Wolfson wolf...@gmail.com wrote: The naïve implementation does sometimes underestimate the total, though.

Re: Count vowels in a string

2014-05-20 Thread blake
To say nothing of y: yes - one vowel any - two vowels but the filter thing is good otherwise. -- 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

Re: Count vowels in a string

2014-05-20 Thread guns
On Tue 20 May 2014 at 04:22:17PM -0700, Ben Wolfson wrote: There are three vowels in naïve, not two. And watch out for those un-normalizable combining character combinations! Also, another one-liner: (defn ascii-vowel-count [s] (count (re-seq #(?i)[aeiou] s))) Doing this in a

Re: Client side tools for Clojure web app (back end questions as well, especially Pedestal)

2014-05-20 Thread Brendan Younger
I second Gary's suggestion of Om/Reagent. I've used Reagent on some personal projects and really like how easy it is to incorporate to the point where I just don't worry about DOM updates any more, only app logic, data storage and transmission. It's also a bit less opinionated on how you

Re: Clojurescript set count returning erroneous values.

2014-05-20 Thread Austin Haas
Unfortunately, no, but not from lack of trying. The best lead I've got thus far is that there is a disj call that returns a defective set, which returns a positive value for count, but does not seem to contain any elements. I've tried to capture the offending values, but I can't reproduce the

Re: Clojurescript set count returning erroneous values.

2014-05-20 Thread Dave Della Costa
Hi Austin, I'm not sure that this is related but I've had an issue with Dates in sets and saw somewhat similar behavior to what you're describing. Context: https://github.com/ddellacosta/date-hash-bug DD (2014/05/21 10:56), Austin Haas wrote: Unfortunately, no, but not from lack of trying.

Re: Joy of Clojure example not working

2014-05-20 Thread gamma235
This did it Greg, Thanks a lot. On Wednesday, May 21, 2014 2:18:08 AM UTC+9, Greg D wrote: Yes, the examples in the book are missing some lines. I think the following log shows what they were going for: joy.udp= (remove-method compiler ::osx) joy.udp= (def unix (into unix {::c-compiler

Re: Count vowels in a string

2014-05-20 Thread Brad Kurtz
I like the one-liner. That was the kind of feedback I was looking for, thanks. On Tuesday, May 20, 2014 6:13:48 PM UTC-5, puzzler wrote: You're seriously overthinking this if it's any more than a one-liner. (defn count-vowels [s] (count (filter #{\a \e \i \o \u \A \E \I \O \U} (seq s

Re: Count vowels in a string

2014-05-20 Thread Mark Engelberg
On Tue, May 20, 2014 at 10:02 PM, Brad Kurtz bkurtz@gmail.com wrote: I like the one-liner. That was the kind of feedback I was looking for, thanks. On Tuesday, May 20, 2014 6:13:48 PM UTC-5, puzzler wrote: You're seriously overthinking this if it's any more than a one-liner. (defn