How to refactor data safely?

2014-05-22 Thread Jakub Holy
I have a nested data structure, used by a bunch of functions that presume knowledge of its structure, and I wonder how to change a part of the structure in a safe way, preferably in small incremental steps, rather than having my code broken until I update all the functions and tests for the new str

Re: How to refactor data safely?

2014-05-22 Thread Ulises
How are you accessing the data? I suppose that if you were accessing (maybe you are) the data via helper functions, that's where most of the refactoring should happen. On 22 May 2014 09:17, Jakub Holy wrote: > I have a nested data structure, used by a bunch of functions that presume > knowledg

Re: Heidegger, literate programming, and communication

2014-05-22 Thread Gregg Reynolds
Howdy Tim, On Thu, May 22, 2014 at 1:16 AM, u1204 wrote: > 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. > Ah, but philosophers never agree. Dis

[ANN] Alia 2.0.0-rc3 - Lightweight Cassandra driver integrated with core.async - Hayt (query dsl)

2014-05-22 Thread Max Penet
Alia 2.* [1] versions bring compatibility with the latest java-driver from Datastax. Support for the latest driver's additions were implemented (query paging among other nice things). On the core.async side we have a new function that allows to "stream" rows into a channel and perform querie

[ANN] Alia 2.0.0-rc3 - Lightweight Cassandra driver integrated with core.async - Hayt (query dsl)

2014-05-22 Thread coltnz
Alia / Hayt are a great combo thanks Max! I'm looking forward to trying Cassandra as a lazy-seq. Colin -- 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

Re: [ANN] Alia 2.0.0-rc3 - Lightweight Cassandra driver integrated with core.async - Hayt (query dsl)

2014-05-22 Thread Max Penet
To give credit where it is due: thanks for the great suggestion(s) :) On Thursday, May 22, 2014 12:17:25 PM UTC+2, coltnz wrote: > > Alia / Hayt are a great combo thanks Max! > > I'm looking forward to trying Cassandra as a lazy-seq. > > Colin > > -- You received this message because you are sub

how to add a function to a collection ?

2014-05-22 Thread sorin cristea
Hi all, do you know how is possible to add a function result, that is another function, to a collection, a list for example: (defn *f1* [msg] (*fn[msg](println (str "hello " msg))*)) (def collection '()) (cons (f1) collection) in this situation f1 must be of type ISeq to can be added to

How should I implement an elevator state-machine with loops and core.async?

2014-05-22 Thread Jesse
Hey guys, I am trying to build a program that can instruct a single elevator, 2 floor system how to behave based on the state of an atom that is being constantly checked for updates by a loop. The state of the atom at a given time is then used to determine the conditional behavior of a move-ele

Re: How should I implement an elevator state-machine with loops and core.async?

2014-05-22 Thread Rob Day
I haven't taken a detailed look yet, but you say you're watching the atom in a background loop - would http://clojuredocs.org/clojure_core/1.2.0/clojure.core/add-watch be more idiomatic and more efficient? Best, Rob On 22 May 2014 14:17, Jesse wrote: > Hey guys, I am trying to build a program th

Re: how to add a function to a collection ?

2014-05-22 Thread Di Xu
> > (defn *f1* [msg] (*fn[msg](println (str "hello " msg))*)) > (def collection '()) > (cons (f1) collection) > ​change ​ (cons (f1) collection) into (cons (f1 "xxx") collection) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

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

2014-05-22 Thread Daniel Higginbotham
Yes, please do open source it! On Tuesday, May 20, 2014 5:33:05 PM UTC-4, 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

Re: how to add a function to a collection ?

2014-05-22 Thread sorin cristea
I see, this is the problem even if I call correct the function, sorry for that missing function parameter, when it will try to add the result of 'f1 "xxx" to 'collection' it will try to transform the result, fn..., to an type ISeq, this is what collection support, and there appear the prob

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

2014-05-22 Thread Thomas
Slightly Off topic, but how can I add new an element to an existing XML file with data.xml. For instance I have: and I want to add element to this like this: The documentation isn't particular clear on how to use the library unfortunately. Thomas -- You received

Re: How should I implement an elevator state-machine with loops and core.async?

2014-05-22 Thread Jesse
> > I haven't taken a detailed look yet, but you say you're watching the > atom in a background loop - would > http://clojuredocs.org/clojure_core/1.2.0/clojure.core/add-watch be > more idiomatic and more efficient? I took the loop out of the* init* function and stuck an *add-watch* on the

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

2014-05-22 Thread Thomas Steffes
Currently config changes that require restart of a component are not supported by our drcfg On Wednesday, May 21, 2014 12:59:18 PM UTC-4, Ben Mabey wrote: > > 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 >

Re: how to add a function to a collection ?

2014-05-22 Thread James Reeves
You have a couple of problems in your code. Let's take it a line at a time: (defn f1 [msg] (fn [msg] (println (str "hello " msg Here you have two "msg" arguments. The inner one will override the outer one. If you want both, they need to be different names. For example: (defn f1 [gree

ANN: ClojureScript 0.0-2227

2014-05-22 Thread David Nolen
ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript New release version: 0.0-2227 Leiningen dependency information: [org.clojure/clojurescript "0.0-2227"] Enhancements * optimized case * CLJS-8

Re: Heidegger, literate programming, and communication

2014-05-22 Thread Andy Fingerhut
On Wed, May 21, 2014 at 11:16 PM, u1204 wrote: > Heck, it is only 4 lines of C++. Why bother? *I* can read C++. I can > even reverse engineer it (probably by inventing the diagram in Figure > 2.7 on a napkin). Maybe it lives in the src/SamRecon/StratSam, which is > all the organization necessary

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

2014-05-22 Thread Matt Mitchell
+1 for open sourcing drcfg! Might be interesting to apply the same idea (drcfg) to the SS component model, where a component manages the atoms instead of having to def them. I did something very similar but on top of Curator. One component defined as a service discovery component, and others th

Re: Count vowels in a string

2014-05-22 Thread Brad Kurtz
keep is cool, thanks for showing me that :) On Wednesday, May 21, 2014 2:35:50 AM UTC-5, Vesa Marttila wrote: > > 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

Re: Heidegger, literate programming, and communication

2014-05-22 Thread Tim Daly
Forward from Ralf Hemmecke: On 05/22/2014 11:21 AM, Gregg Reynolds wrote: > I can tell you I would rather maintain the four lines of C++ without > the largely useless commentary. That's a simple AXIOM program, but I'm sure one can easily translate it into any programming language. foo(a: Intege

Re: Heidegger, literate programming, and communication

2014-05-22 Thread Tim Daly
>Tim, as someone already mentioned, the multi-page Java code you posted from >"the Clojure core" is actually one file from the Java ASM library, copied >into the Clojure Github repository from one version of that library >available from here: Hmmm, I didn't see that in the documentation :-) Thanks

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

2014-05-22 Thread Herwig Hochleitner
2014-05-21 21:06 GMT+02:00 Paul Gearon : > > Are QNames strictly necessary? Keywords seem to do the trick, and they > work in nicely with what already exists. > > I know that there are some QName forms that are not readable as a keyword, > but the XML parsing code will always call (keyword ...) an

Re: [Axiom-developer] Heidegger, literate programming, and communication

2014-05-22 Thread Tim Daly
>PS I have many chunks of code that I wrote 20-30 years ago and I have no >idea why and what the code was written for even after reading each >line of the code This is what got me interested in literate programming. Axiom was written at IBM as "research code", mostly by people trying to

Re: Heidegger, literate programming, and communication

2014-05-22 Thread Mars0i
Tim, Your project of LP'ing the Clojure internals is not at all inconsistent with my view. That is code that would benefit from being widely understood, even by people who won't maintain it. I learned a lot from reading the "Lions" book on an early version of Unix, even though I probably ne

Re: [Axiom-developer] Heidegger, literate programming, and communication

2014-05-22 Thread Gary Johnson
Hi folks, I suspect I'm the Gary that Tim thought he was referring to since I've posted on several of his other LP-related threads (though not this one until now). I'm reading along and enjoying the back and forth as usual, but I'm sorry to say that I don't have much to add to this philosophi

Re: Heidegger, literate programming, and communication

2014-05-22 Thread Andy Fingerhut
On Thu, May 22, 2014 at 11:05 AM, Tim Daly wrote: > >Tim, as someone already mentioned, the multi-page Java code you posted > from > >"the Clojure core" is actually one file from the Java ASM library, copied > >into the Clojure Github repository from one version of that library > >available from

Re: Heidegger, literate programming, and communication

2014-05-22 Thread daly
>I know Clojure doesn't have all the documentation many would like, but Tim, >this bit of info is in readme.txt, and the first 3 lines of every source >file from the library :-) Touche! +2 points to you! I love it when my oh-so-noisy self gets skewered by facts! :-) Tim Daly -- You received th

Re: [Axiom-developer] Heidegger, literate programming, and communication

2014-05-22 Thread Mars0i
On Thursday, May 22, 2014 4:05:58 PM UTC-5, Gary Johnson wrote: > > Hi folks, > > I suspect I'm the Gary that Tim thought he was referring to since I've > posted on several of his other LP-related threads (though not this one > until now). > I cede the name "Gary" to Gary. > But really,

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

2014-05-22 Thread Bronsa
Hi, When using tools.analyzer.jvm you have to remember that its primary use-case is as a front-end for a compiler, in this case :tag and :o-tag serve to inform tools.emitter.jvm when to emit a cast thus might not always reflect the :tag meta of the expression :form. Regarding the :tag/:o-tag diff

Re: [Axiom-developer] Heidegger, literate programming, and communication

2014-05-22 Thread Gary Johnson
On Thursday, May 22, 2014 6:20:39 PM UTC-4, Mars0i wrote: > > On Thursday, May 22, 2014 4:05:58 PM UTC-5, Gary Johnson wrote: >> >> Hi folks, >> >> I suspect I'm the Gary that Tim thought he was referring to since I've >> posted on several of his other LP-related threads (though not this one >>

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

2014-05-22 Thread David Gartner
Awesome ... thanks a bunch Carlo :) On Wednesday, May 21, 2014 8:53:18 PM UTC-6, David Gartner wrote: > > 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

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

2014-05-22 Thread Jason Gilman
Thanks for the videos. The first one was good. What text editor are you using in the videos? I haven't seen that one before. -- 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 post

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

2014-05-22 Thread Timothy Baldridge
I'm using Cursive Clojure (Intelij). It has a "Presentation Mode" which is pretty good, but I use Cursive as my main IDE these days. On Thu, May 22, 2014 at 7:41 PM, Jason Gilman wrote: > Thanks for the videos. The first one was good. What text editor are you > using in the videos? I haven't see

SocketError when using DataInputStream with Clojure TCP server

2014-05-22 Thread Dylan Gleason
I am working with the TCP server example from the *Clojure Cookbook* to create an echo server. I am trying to modify it so that the receive function uses a DataInputStream and reads the incoming request as a byte array. However, I am having difficulty getting it to work. Here is what I have so

Re: Help with a memory leak

2014-05-22 Thread Mars0i
On Wednesday, May 21, 2014 7:43:41 PM UTC-5, Bauna wrote: > > The main loop is here[2] in the function trace-gen that generates a lazy > list. I don't care about the memory required during the execution of the > function but after it should be GC'd all. > Just a quick question: Have you check