Question regarding tools.analyzer.jvm and the :tag, :o-tag, and :class entries

2014-05-21 Thread guns
Hello, This question is primarily addressed to Nicola Mometto, but I am sending it to the list so it may be helpful to other Clojure developers. Help is appreciated, regardless of the source. I am using tools.analyzer(.jvm) to build a Closeable resource linter, but I have run into the following p

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

2014-05-21 Thread Manuel Paccagnella
FWIW, I’ve recently implemented a configuration library for a work project. It’s file-based, but I’m also investigating different approaches on configuration management. Mainly on this areas: - Configuration as a service. - Real-time configuration changes (w/ REST interface to hook UIs)

Heidegger, literate programming, and communication

2014-05-21 Thread daly
The primary focus of a "documentation system" is communication from the author to the audience. One of the struggles apparent in discussing issues of communication, especially with programmers, is Heideggers "present-at-hand" vs "breaking down". Programmers write programs to instruct a machine t

Re: Count vowels in a string

2014-05-21 Thread Vesa Marttila
On Wednesday, May 21, 2014 2:03:14 AM UTC+3, Brad Kurtz wrote: > > 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' opin

Re: Count vowels in a string

2014-05-21 Thread Plínio Balduino
My one cent: (defn count-vowels ([^String text] (count-vowels text "aeiouAEIOU")) ([^String text ^String accepted-vowels] (let [vowel? (set accepted-vowels)] (->> text (filter vowel?) count user=> (count-vowels "Plínio Balduino") 6 user=> (count-vowels

Re: Clojure Office Hours - Experience Report and Future Plans

2014-05-21 Thread Zach Tellman
For the in-person variety, I've written up some thoughts on why office hours are a good format for meetups, and ideas on the underlying processes: http://blog.factual.com/clojure-office-hours. On Thursday, April 24, 2014 8:44:08 PM UTC-7, Leif wrote: > > This message is aimed at people that want

Idiomatic clojure on building a sequence

2014-05-21 Thread Colin Yates
I often find myself doing the following: (let [some-seq [] some_seq (if some-condition? (conj some-seq some-element) some-seq) some_seq (if some-other-condition? (conj some-seq some-other-element) some-seq) some_seq etc.]) In other words building up a sequence which contains th

Re: Idiomatic clojure on building a sequence

2014-05-21 Thread Herwig Hochleitner
I like to build more complex sequences within the sequence monad, like this: (concat (when cond1 [start elements]) main-seq (when cond2 [end elements])) This also composes nicely with function calls. Another option for a subset of cases: (cond-> start-vec condition1 (conj end-element1)

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

2014-05-21 Thread Ben Mabey
On 5/20/14, 3:33 PM, Thomas Steffes wrote: 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 t

Re: [RFC] Roundtripping namespaced xml documents for data.xml

2014-05-21 Thread Paul Gearon
Hi Herwig, I needed this myself and took a stab at it before it occurred to me to look for other implementations and found yours. I like the way that you have split the implementation of functionality into different namespaces. The current release is a little monolithic. One thing that bothers m

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

2014-05-21 Thread Marc Limotte
I wrote a ZooKeeper based config system at Climate Corporation. I also found that there is a need to trigger some action when a config value changes, and went with a simple callback solution. I do like the idea of tying this to Stuart's Component lifecycle model; although I think you would also n

Re: Heidegger, literate programming, and communication

2014-05-21 Thread Gregg Reynolds
Hi Tim, I'm glad you're continuing the conversation, which has helped me at least to clarify my thinking about not just LP but about the nature of programming and the sort of tools we (or I at least) need to support good programming. I end up in a very different place than you, but I don't think

Re: [RFC] Roundtripping namespaced xml documents for data.xml

2014-05-21 Thread Herwig Hochleitner
2014-05-21 19:31 GMT+02:00 Paul Gearon : > > I needed this myself and took a stab at it before it occurred to me to > look for other implementations and found yours. > Hi Paul, good to hear you are interested in this effort. I like the way that you have split the implementation of functionality

Re: [RFC] Roundtripping namespaced xml documents for data.xml

2014-05-21 Thread Paul Gearon
Hi Herwig, Thanks for the response. I'll remove some of the less relevant bits as I reply inline... On Wed, May 21, 2014 at 2:26 PM, Herwig Hochleitner wrote: > 2014-05-21 19:31 GMT+02:00 Paul Gearon : > >> I like the way that you have split the implementation of functionality >> into different

Re: [RFC] Roundtripping namespaced xml documents for data.xml

2014-05-21 Thread Thomas
Hi, Speaking of Clojure and XML, what is the preferred way of dealing with XML in Clojure these days? In the past I have used clojure.xml and clojure.zip. Is clojure.data.xml the best way to do this now? TIA, Thomas -- You received this message because you are subscribed to the Google Groups

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

2014-05-21 Thread Manuel Paccagnella
BTW, just to clarify: even if it's used in a closed-source product, this configuration library is open-source on GitHub, I'm going to post the link if someone is interested. Cheers, Manuel Il giorno mercoledì 21 maggio 2014 11:57:51 UTC+2, Manuel Paccagnella ha scritto: > > FWIW, I’ve recently

stderr with repl development

2014-05-21 Thread Brian Craft
Still not able to track down stderr. Anyone know how this stuff works? Dumping *err* from a ring handler, running from jetty, I get this: java.io.PrintWriter@1d9e436a. This will write to the repl terminal, so long as I flush (wtf... stderr is buffered?). If I dump *err* from a future, I get th

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

2014-05-21 Thread Chris Price
I'm interested! One of the things on the wish list for trapperkeeper is to make our current configuration service swappable--currently it only supports files, but I'd really like to be able to swap in a database-backed config or zookeeper-based implementation. When we get some time to work on

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

2014-05-21 Thread Chris Price
On Wednesday, May 21, 2014 11:14:28 AM UTC-7, mlimotte wrote: > > I wrote a ZooKeeper based config system at Climate Corporation. I also > found that there is a need to trigger some action when a config value > changes, and went with a simple callback solution. I do like the idea of > tying th

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

2014-05-21 Thread Marc Limotte
Not yet, but I hope to be able to do that in the future. On Wed, May 21, 2014 at 4:17 PM, Chris Price wrote: > On Wednesday, May 21, 2014 11:14:28 AM UTC-7, mlimotte wrote: >> >> I wrote a ZooKeeper based config system at Climate Corporation. I also >> found that there is a need to trigger som

Re: stderr with repl development

2014-05-21 Thread Brian Craft
A small clue, gleaned from a cider issue: This outputs to the repl terminal. (future (.start (Thread. #(println "blah2" This output is captured by vim. (future (println "blah3")) Still no idea what's going on. On Wednesday, May 21, 2014 1:09:31 PM UTC-7, Brian Craft wrote: > > Still not a

Re: [RFC] Roundtripping namespaced xml documents for data.xml

2014-05-21 Thread Paul Gearon
My understanding is that this is the central library for XML, so theoretically it's preferred. This is why I'm trying to use it. Also, it's one of the few implementations using StAX, which is the best way to do lazy streaming (though core.async makes SAX a viable option again). However, without na

Re: stderr with repl development

2014-05-21 Thread Gary Trakhman
I use this trick pretty much all the time. (alter-var-root #'*out* (constantly *out*)), same for *err*, though I'll wire *err* to *out* (future (println "blah3")) works because *out* is conveyed to the future via binding-conveyor-function. That's not the case in the first. On Wed, May 21, 201

Re: Heidegger, literate programming, and communication

2014-05-21 Thread Mars0i
On Wednesday, May 21, 2014 6:03:04 AM UTC-5, da...@axiom-developer.org wrote: > > The primary focus of a "documentation system" is communication from > the author to the audience. > > One of the struggles apparent in discussing issues of communication, > especially with programmers, is Heideg

Re: stderr with repl development

2014-05-21 Thread Brian Craft
On Wednesday, May 21, 2014 2:10:06 PM UTC-7, Gary Trakhman wrote: > > I use this trick pretty much all the time. > > (alter-var-root #'*out* (constantly *out*)), same for *err*, though I'll > wire *err* to *out* > > Wow, I have no clue what that does. When do you run this? When would *out* not

Re: Heidegger, literate programming, and communication

2014-05-21 Thread Mars0i
Tim, >From my point of view there are at least a few things that seem clear: 1. I think that Gregg Reynolds and I agree on a lot, but I would add to his remarks that there is almost always a human audience for source code, as well as the compiler/interpreter. Sometimes, the audience is just th

Re: stderr with repl development

2014-05-21 Thread Gary Trakhman
Ah, so in my case, I run that snippet when I want *other* threads to write to stdout/stderr buffers instead of showing up in the terminal. In your case, you could rebind vim's *err* to its *out*, since you say anything sent to *err* doesn't show up (unless it's not seeing vim's binding), but *out*

Re: stderr with repl development

2014-05-21 Thread Gary Trakhman
you probably want to use set! for that instead of alter-var-root. On Wed, May 21, 2014 at 5:44 PM, Gary Trakhman wrote: > Ah, so in my case, I run that snippet when I want *other* threads to write > to stdout/stderr buffers instead of showing up in the terminal. In your > case, you could rebind

Re: Idiomatic clojure on building a sequence

2014-05-21 Thread Jan Herich
Hi Colin, Have a look at the 'as->' macro, its very helpful in some cases, as: (-> [] (conj some-element) (as-> some-seq (if some-condition? (conj some-seq some-element) some-seq) (if some-other-condition? (conj some-seq some-other-element) some-seq)) (t

Re: Idiomatic clojure on building a sequence

2014-05-21 Thread Colin Yates
Thanks Herwig, cond-> looks just the ticket. Off the read the core API again :). On Wednesday, 21 May 2014 17:49:11 UTC+1, Herwig Hochleitner wrote: > > I like to build more complex sequences within the sequence monad, like > this: > > (concat > (when cond1 [start elements]) > main-seq > (

[ANN] core.async (and more) video tutorials

2014-05-21 Thread Timothy Baldridge
>From time to time I get asked to do more writing on core.async, and I've come to the realization that try as I might, I'm not a writer. However I recently started a set of video tutorials I'm making available today. The videos average about 12min in length and focus on a single topic. Currently I

Re: [ANN] core.async (and more) video tutorials

2014-05-21 Thread Devin Walters
Awesome! Thanks Tim! '(Devin Walters) > On May 21, 2014, at 17:32, Timothy Baldridge wrote: > > From time to time I get asked to do more writing on core.async, and I've come > to the realization that try as I might, I'm not a writer. However I recently > started a set of video tutorials I'm m

Re: Idiomatic clojure on building a sequence

2014-05-21 Thread Colin Fleming
Another option that I've been using a bit recently is: (->> [(if some-condition? some-thing) (if some-other-condition? some-other-thing) ...] (filterv (complement nil?))) Which when the list of expressions is long (more than 3-4 or so) is the most readable alternative I've come u

Help with a memory leak

2014-05-21 Thread Pablo Nussembaum
Hello Devs, I'm working a tool for my thesis using clojure for the first time. The tools will randomly execute methods of a java class for generating an state machine of the API. The java class is annotated with preconditions that are compiled to clojure functions. You can see and example here[1

xsl:clj-ext : Live test documentation (or: Illiterate Programming I)

2014-05-21 Thread Gregg Reynolds
Hi list, xsl.clj-ext is a very simple implementation of an XSL extension function that evaluates Clojure code. It's just proof-of-concept stuff at the moment but it works well enough to play around with it. The provided minimal example shows how to embed

Re: [ANN] core.async (and more) video tutorials

2014-05-21 Thread Ambrose Bonnaire-Sergeant
Nice work! I've really enjoyed your past videos. Ambrose On Thu, May 22, 2014 at 6:32 AM, Timothy Baldridge wrote: > From time to time I get asked to do more writing on core.async, and I've > come to the realization that try as I might, I'm not a writer. However I > recently started a set of vi

Re: Heidegger, literate programming, and communication

2014-05-21 Thread Gregg Reynolds
On Wed, May 21, 2014 at 4:39 PM, Mars0i wrote: > Tim, > > From my point of view there are at least a few things that seem clear: > > 1. I think that Gregg Reynolds and I agree on a lot, but I would add to > his remarks that there is almost always a human audience for source code, > as well as the

passing a non-anoymous function as an argument to another clojure function

2014-05-21 Thread David Gartner
A totally noob question so please bear with me ... I'm trying to pass a function to another function in the REPL like so: function number 1: (defn div [x y] (/ x y)) function number 2: ;; this is from the "joy of clojure" (defn throw-catch [f] [(try (f) (catch ArithmeticException e

Re: Heidegger, literate programming, and communication

2014-05-21 Thread u1204
Gregg and Gary, I understand where you are coming from. Indeed, Maturana [0] is on your side of the debate. Since even the philosophers can't agree, I doubt we will find a common ground. Unfortunately, I've decided to take on the task of documenting the Clojure internals because, yaknow, *I* don

Re: passing a non-anoymous function as an argument to another clojure function

2014-05-21 Thread Carlo Zancanaro
On Wed, May 21, 2014 at 07:53:18PM -0700, David Gartner wrote: > (defn div [x y] > (/ x y)) > > (defn throw-catch [f] > [(try > (f) > (catch ArithmeticException e "No dividing by zero!") > (catch Exception e (str "You are so bad " (.getMessage e))) > (finally (println "returning.