Re: Clojure 1.5.0 bug (Java interop: Compiler.load(new StringReader(str));)

2013-03-12 Thread Andy Fingerhut
OK, I don't know whether this is really a bug or just an obsolete message being printed on the console, but I've reopened the ticket and added a pointer to this discussion, and a link to exactly which commit it was that caused this change in behavior (just before Clojure 1.5.0-RC4). Andy On Ma

Re: Clojure 1.5.0 bug (Java interop: Compiler.load(new StringReader(str));)

2013-03-12 Thread Sean Corfield
Based on discussions I've seen on this list and clojure-dev, I think you're using internal APIs that are not considered "supported" and therefore subject to change at any time. I asked about using clojure.lang.RT a while ago and was told to rely on very little of the API, for example, so all I rel

Re: Redefinition of datatypes

2013-03-12 Thread Ambrose Bonnaire-Sergeant
core.typed dependencies are all in Central now. Here's a reproducible example of this failure. http://build.clojure.org/job/core.typed/3/console Thanks, Ambrose On Sun, Feb 24, 2013 at 12:50 AM, Chas Emerick wrote: > On Feb 23, 2013, at 11:35 AM, Stuart Sierra wrote: > > Furthermore, accordin

ClojureCLR - Question about the "Debug 3.5" build configuration and "System.Reflection.Assembly.IsDynamic" property

2013-03-12 Thread FC
Hi, I'm trying to build ClojureCLR from the latest clojure-clr-master.ZIP file I downloaded from GitHub. With "Debug 3.5" as the build configuration I get a compilation error in Clojure\lib\RT.cs that "System.Reflection.Assembly does not contain a definition for 'IsDynamic'". Is this expecte

Re: Clojure 1.5.0 bug (Java interop: Compiler.load(new StringReader(str));)

2013-03-12 Thread Taegyoon Kim
But then(putting RT.init()), Compiler.load() works, but Console (stderr?) says No need to call RT.init() anymore So I think this problem should be fixed. 2013년 3월 13일 수요일 오전 11시 32분 5초 UTC+9, Andy Fingerhut 님의 말: > Yegor Bugayenko posted in a comment on ticket CLJ-1172 ( > http://dev.cloj

Re: What causes the text that I print to the terminal to become mangled garbage?

2013-03-12 Thread Jason Lewis
tl;dr concurrency is hard Jason Lewis Email jasonlewi...@gmail.com Twitter@canweriotnow Blog http://decomplecting.org About http://about.me/jason.lewis On Tue, Mar 12, 2013 at 11:27 PM, Michael Klishin < michael.s.klis...@g

What causes the text that I print to the terminal to become mangled garbage?

2013-03-12 Thread larry google groups
I saw some functions here that measure CPU and thread usage: http://lifeisagraph.com/2011/04/24/debugging-clojure.html That looked good, so I imported them into my app. I've done this before and not had a problem with it. For logging, I like to use the Timbre library: https://github.com/pta

[ANN] Syme: for real-time collaborating over SSH

2013-03-12 Thread Phil Hagelberg
Hello folks. I'd like to announce a side-project I've been working on: https://syme.herokuapp.com >From the FAQ: (https://syme.herokuapp.com/faq) # So what does Syme offer? It sets up disposable EC2 nodes for collaborating on GitHub projects via ssh and tmux. * Enter the name of a GitHub

Re: Clojure 1.5.0 bug (Java interop: Compiler.load(new StringReader(str));)

2013-03-12 Thread Andy Fingerhut
Yegor Bugayenko posted in a comment on ticket CLJ-1172 ( http://dev.clojure.org/jira/browse/CLJ-1172) that calling RT.init() before Compiler.load() solved what looks like a similar problem for him. Andy On Tue, Mar 12, 2013 at 6:29 PM, Taegyoon Kim wrote: > A new error occurred in Clojure 1.5.0

Clojure 1.5.0 bug (Java interop: Compiler.load(new StringReader(str));)

2013-03-12 Thread Taegyoon Kim
A new error occurred in Clojure 1.5.0. (Java interop: Compiler.load(new StringReader(str));) # Code # import java.io.IOException; import java.io.StringReader; import clojure.lang.Compiler; import clojure.lang.RT; import clojure.lang.Var; public class Main { public static void main(String[]

Re: What's the point of -> ?

2013-03-12 Thread Brandon Bloom
One other thing to consider is partial application. The collection functions tend to put the most-likely-to-be-curried arguments first. For example: (def sum (partial reduce + 0)) Compare to coll-reduce, which dispatches on the type of the first argument: (require '[clojure.core.protocols :ref

Re: Java interop: "Can't call public method of non-public class"

2013-03-12 Thread Sean Corfield
On Tue, Mar 12, 2013 at 5:46 PM, wrote: > In my case i am trying to get clojure working with netty 4, here is the > code: > > (def #^AbstractBootstrap b (ServerBootstrap.)) > (.channel ^AbstractBootstrap b ^Class > io.netty.channel.socket.nio.NioServerSocketChannel) > > which returns the error: >

Re: Clojure HTML5 Game Development

2013-03-12 Thread George Oliver
On Tuesday, March 12, 2013 1:34:21 PM UTC-7, Reginald Choudari wrote: > > Any resources/people dedicated to game development using > Clojure/Clojurescript? > I have made a couple games using HTML5/Javascript with the canvas element, > and seeing that Clojurescript can replace Javascript coupled

Re: Java interop: "Can't call public method of non-public class"

2013-03-12 Thread shlomivaknin
I meant to post this as a reply to https://groups.google.com/d/msg/clojure/jYfEKVH5GsQ/3Hq5hU0u6UQJ In my case i am trying to get clojure working with netty 4, here is the code: (def #^AbstractBootstrap b (ServerBootstrap.)) (.channel ^AbstractBootstrap

Re: Java interop: "Can't call public method of non-public class"

2013-03-12 Thread Shlomi Vaknin
hey, I have a similar problem, even when i type annotate with clojure 1.5 i still get that error.. any suggestions? -- -- 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

Re: Java interop with dynamic proxies

2013-03-12 Thread Jonathan Fischer Friberg
I think you can simply use 'Fred' instead of 'Fred.class'. Since, in the repl: (class Integer) ;=> java.lang.Class I.e. just by using the name, we get a Class object, which should correspond to .class in java. In other words, you should be able to run: (let [f (Factory/createInstance) fre

ANN: Xenopath 0.1.0 (XPath for Clojure)

2013-03-12 Thread Jeremy Heiler
I've released 0.1.0 of my XPath library. My goal is to create a light library that wraps Java's javax.xml.xpath and org.w3c.dom packages. It's not feature complete, but it should be enough to get started with XPath. Any feedback is appreciated! https://github.com/jeremyheiler/xenopath //Jeremy

Re: Java interop with dynamic proxies

2013-03-12 Thread Brian Goslinga
Do you want to know how to define Fred, or how to translate the above code snippet? -- -- 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 - ple

Re: Clojure HTML5 Game Development

2013-03-12 Thread Marco Munizaga
I'm thinking about writing an idiomatic wrapper for the gameclosure library, I'm going to call it gameclojurescript. It's good to see other people wanting to do this too! On Tuesday, March 12, 2013 4:34:21 PM UTC-4, Reginald Choudari wrote: > > Any resources/people dedicated to game development

Re: fold over a sequence

2013-03-12 Thread Stuart Sierra
See clojure.org/contributing it's all there. On Tuesday, March 12, 2013, Paul Butcher wrote: > On 12 Mar 2013, at 18:26, Stuart Sierra > 'the.stuart.sie...@gmail.com');>> > wrote: > > This might be an interesting contribution to clojure.core.reducers. I > haven't looked at your code in detail,

Re: Clojure HTML5 Game Development

2013-03-12 Thread Claudia Doppioslash
> I was thinking of moving over to the Clojureway of coding things.. Any suggestions? I'm looking into that myself. The most promising approach I think is to use Gambit ( https://github.com/ibdknox/gambit ) from Chris Granger, he built ChromaShift on it ( https://github.com/ibdknox/ChromaShift )

Java interop with dynamic proxies

2013-03-12 Thread Thomas
Hi All, I have to interface with a Java project that is used in the following way: Factory f = Factory.createInstance(); Fred fred = f.create( Fred.class); fred.setName( "Fred"); Where Fred is just an interface with some getters and setters, and I guess the dynamic proxy generates the right cod

Clojure HTML5 Game Development

2013-03-12 Thread Reginald Choudari
Any resources/people dedicated to game development using Clojure/Clojurescript? I have made a couple games using HTML5/Javascript with the canvas element, and seeing that Clojurescript can replace Javascript coupled with Clojure hosting an HTTP web server, I was thinking of moving over to the Cl

Re: ANN Validateur 1.4 is released

2013-03-12 Thread Michael Klishin
2013/3/13 Jonathan Fischer Friberg > "We recommend all users to upgrade to > 1.7.0 > ." > > I'm guessing it should be 1.4.0? > Correct, thanks for spotting. -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin

Re: ANN Validateur 1.4 is released

2013-03-12 Thread Jonathan Fischer Friberg
"We recommend all users to upgrade to 1.7.0 ." I'm guessing it should be 1.4.0? Jonathan On Tue, Mar 12, 2013 at 8:58 PM, Michael Klishin < michael.s.klis...@gmail.com> wrote: > Validateur is a functional validations library inspi

ANN Validateur 1.4 is released

2013-03-12 Thread Michael Klishin
Validateur is a functional validations library inspired by Ruby's ActiveModel. Release notes for 1.4: http://blog.clojurewerkz.org/blog/2013/03/12/validateur-1-dot-4-0-is-released/ 1. http://clojurevalidations.info -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- --

ANN Pantomime 1.7 is released

2013-03-12 Thread Michael Klishin
Pantomime [1] is a tiny Clojure library that deals with MIME types. Release notes: http://blog.clojurewerkz.org/blog/2013/03/12/pantomime-1-dot-7-0-is-released/ 1. http://github.com/michaelklishin/pantomime -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You re

Re: fold over a sequence

2013-03-12 Thread Paul Butcher
On 12 Mar 2013, at 18:26, Stuart Sierra wrote: > This might be an interesting contribution to clojure.core.reducers. I haven't > looked at your code in detail, so I can't say for sure, but being able to do > parallel fold over semi-lazy sequences would be very useful. I'd be delighted if this

Re: What's the point of -> ?

2013-03-12 Thread Gary Verhaegen
As I recall, Rich's explanation was basically that concrete types (collections) go first and abstractions (mostly sequence) go last. Hence (conj coll el), (cons el seq), (drop n seq), (assoc coll ...), etc. He also said that it was not a hard rule, so there might be exceptions in the standard libr

Re: lazy seqs overflow the stack?

2013-03-12 Thread Stuart Sierra
Yes. `concat` in a loop is tricky: each additional concatenation creates a new lazy sequence object which points to the previous lazy sequence. If you get too many of those, trying to realize the lazy sequence will cause a stack overflow. In general, I recommend using `concat` only in recursive

Re: nameclashes with java.lang

2013-03-12 Thread Stuart Sierra
Actually, simply creating a namespace imports all of java.lang. The `ns` macro is responsible only for referring clojure.core. That's been true since 1.0. The only workaround right now is ns-unmap. -S On Wednesday, March 6, 2013 8:33:34 AM UTC-5, Jim foo.bar wrote: > > On 06/03/13 10:41, Phil

Re: fold over a sequence

2013-03-12 Thread Stuart Sierra
Hi Paul, This might be an interesting contribution to clojure.core.reducers. I haven't looked at your code in detail, so I can't say for sure, but being able to do parallel fold over semi-lazy sequences would be very useful. -S On Tuesday, March 12, 2013 9:34:43 AM UTC-4, Paul Butcher wrote:

Re: Moving ClojureScript to Clojure 1.5.0 & data.json dependency

2013-03-12 Thread David Nolen
Great! On Tue, Mar 12, 2013 at 2:16 PM, Stuart Sierra wrote: > No issue from me. Just make sure you get the right version of data.json: > 0.2.0 was a bad release. Use 0.2.1. > > -S > > > > On Friday, March 1, 2013 2:41:26 PM UTC-5, David Nolen wrote: >> >> Now that Clojure 1.5.0 is out the door

Re: Moving ClojureScript to Clojure 1.5.0 & data.json dependency

2013-03-12 Thread Stuart Sierra
No issue from me. Just make sure you get the right version of data.json: 0.2.0 was a bad release. Use 0.2.1. -S On Friday, March 1, 2013 2:41:26 PM UTC-5, David Nolen wrote: > > Now that Clojure 1.5.0 is out the door I'd like to make ClojureScript > depend on it. This would allow me to merge i

Re: What's the point of -> ?

2013-03-12 Thread Sean Corfield
On Tue, Mar 12, 2013 at 10:21 AM, Neale Swinnerton wrote: > if designing from scratch should we favour being threadable with -> or ->> ? My understanding is that the two threading macros are there to support two existing standard idioms in Clojure: * functions operating on collections tend to hav

Re: Convincing employer to go for Clojure

2013-03-12 Thread David Jacobs
All of the feedback here was really helpful. As a followup, I wanted to let you know that my company is The Minerva Project, and we've been given $25 million to build a university. After a lot of back and forth about which technology we wanted to use on the product side, we ended up settling o

Re: What's the point of -> ?

2013-03-12 Thread Neale Swinnerton
I find the need to switch between -> and ->> in a pipeline disturbs the clarity of my code. if designing from scratch should we favour being threadable with -> or ->> ? Is one more idiomatic than the other? *Neale Swinnerton* {t: @sw1nn , w: sw1nn.com } On Tue,

Re: What's the point of -> ?

2013-03-12 Thread Sean Corfield
On Tue, Mar 12, 2013 at 2:07 AM, Marko Topolnik wrote: > In Clojure 1.5 I would write Yes, well, we'll be on 1.5.1 soon. Since this is heavily used production code, we've been waiting for a gold release and for the memory leak to get fixed before moving to 1.5.x :) > (as-> response x (:body x) (

Re: What's the point of -> ?

2013-03-12 Thread Sean Corfield
On Tue, Mar 12, 2013 at 2:54 AM, Laurent PETIT wrote: > (-> response :body :postalCodes (->> (map to-location) (sort-by :city))) Ah, nice... I'll bear that in mind! -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ "

Re: fold over a sequence

2013-03-12 Thread Paul Butcher
On 12 Mar 2013, at 15:55, Alan Busby wrote: > If Paul wouldn't mind I'd like to add a a similar "seq" function to Iota that > would allow for index-less processing like he did in foldable-seq. Paul would be delighted :-) -- paul.butcher->msgCount++ Snetterton, Castle Combe, Cadwell Park... Wh

Re: fold over a sequence

2013-03-12 Thread Alan Busby
On Tue, Mar 12, 2013 at 11:00 PM, Paul Butcher wrote: > On 12 Mar 2013, at 13:49, Adam Clements wrote: > > How would feeding a line-seq into this compare to iota? And how would that > compare to a version of iota tweaked to work in a slightly less eager > fashion? > > > It'll not suffer from the

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
David you are a genious!!! thank you thank you very much!!! one of my dependencies was pulling in opennlp/tools 1.5.0 which is a 2 year old jar!!! added :exclusions and now I'm back in the game If you're in Manchester Uk I'm buying beer... :) Jim On 12/03/13 14:49, David Powell wrote: It lo

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
that is a reasonable thought indeed but it is extremely unlikely that something like this is happening...the version of opennlp I'm using is my own home-brewed one which I've manually installed in my local-repo for sometime now...in my project.clj the dependency looks like this: [experiment/ex

Re: strange interop behaviour/issue

2013-03-12 Thread David Powell
It looks like: public String[] tag(String[] sentence, Object[] additionaContext); wasn't originally present in the API, and was added in: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java?r1=1245855&r2=1294177 It sounds like you might h

Re: Model-View-Controller in Clojure?

2013-03-12 Thread Jim - FooBar();
On 12/03/13 14:43, edw...@kenworthy.info wrote: Just to close this off, this is my (now working!) code, still needs some re-factoring (especially given Jim's last note re not needing watches in seesaw). It's basically a gui wrapped around the implementation of Life from Clojure Programming, wit

Re: Model-View-Controller in Clojure?

2013-03-12 Thread edward
Thanks all. Just to close this off, this is my (now working!) code, still needs some re-factoring (especially given Jim's last note re not needing watches in seesaw). It's basically a gui wrapped around the implementation of Life from Clojure Programming, with a few functions to add gliders, gu

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
On 12/03/13 14:31, Marko Topolnik wrote: What explains the occurrence of these extra signatures that you don't mention above? It's hard to answer without having the full picture. they are deprecated...there are 5 .tag() overloads in total. 2 of them are deprecated (the one accepting List and t

Re: strange interop behaviour/issue

2013-03-12 Thread Marko Topolnik
What explains the occurrence of these extra signatures that you don't mention above? It's hard to answer without having the full picture. On Tuesday, March 12, 2013 2:52:19 PM UTC+1, Jim foo.bar wrote: > > Ok I investigated a bit further and I found some seriously weird > stuff...I'm gonna need

someClass.getMethods() misses 2 public methods! how is that even possible?

2013-03-12 Thread Jim - FooBar();
the title says it all...I'm left speechless! see my previous post for details ("strange interop behaviour/issue") thanks in advance for any insight... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: fold over a sequence

2013-03-12 Thread Paul Butcher
On 12 Mar 2013, at 13:49, Adam Clements wrote: > How would feeding a line-seq into this compare to iota? And how would that > compare to a version of iota tweaked to work in a slightly less eager fashion? It'll not suffer from the problem of having to drag the whole file into memory, but will

Re: fold over a sequence

2013-03-12 Thread Paul Butcher
On 12 Mar 2013, at 13:52, Marko Topolnik wrote: > That's what I meant, succeed by relying on the way f/j is used by the > reducers public API, without copy-pasting the internals and using them > directly. So I guess the answer is "no". I don't believe that I could - the CollFold implementation

Re: fold over a sequence

2013-03-12 Thread Marko Topolnik
On Tuesday, March 12, 2013 2:48:52 PM UTC+1, Paul Butcher wrote: > On 12 Mar 2013, at 13:45, Marko Topolnik > > wrote: > > Nice going :) Is it really impossible to somehow do this from the outside, > through the public API? > > > I think that it *does* do it from the outside through the public A

Re: strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
Ok I investigated a bit further and I found some seriously weird stuff...I'm gonna need the help of a java expert here: (pprint (.getMethods (.getClass opennlp-pos))) ;;notice that the method I'm trying to call *doesn't exist according to this* [#opennlp.tools.postag.POSTaggerME.trai

Re: fold over a sequence

2013-03-12 Thread Adam Clements
I've had exactly this problem trying to use reducers over a large file that wouldn't fit in memory. I tried iota, but had the issue that it was still scanning and memory mapping the entire file before it would start doing anything (pulling the whole thing through ram and taking a fair few minut

Re: fold over a sequence

2013-03-12 Thread Paul Butcher
On 12 Mar 2013, at 13:45, Marko Topolnik wrote: > Nice going :) Is it really impossible to somehow do this from the outside, > through the public API? I think that it *does* do it from the outside through the public API :-) I'm just reifying the (public) CollFold protocol. I do copy a bunch

Re: fold over a sequence

2013-03-12 Thread Marko Topolnik
Nice going :) Is it really impossible to somehow do this from the outside, through the public API? On Tuesday, March 12, 2013 2:34:43 PM UTC+1, Paul Butcher wrote: > > So this turned out to be pretty easy. I've implemented a function called > "foldable-seq" that takes a lazy sequence and turns i

Re: fold over a sequence

2013-03-12 Thread Paul Butcher
So this turned out to be pretty easy. I've implemented a function called "foldable-seq" that takes a lazy sequence and turns it into something that can be folded in parallel. I've checked an example program that uses it to count words in a Wikipedia XML dump into GitHub: https://github.com/paul

strange interop behaviour/issue

2013-03-12 Thread Jim - FooBar();
Hi all, I came back to a project of mine after a week or so and I'm facing a problem which I have no idea where it came from! This is the first time I'm seeing it on this project - everything worked just fine a week ago! The problem is this: Consider some java class (opennlp-POS-tagger) with

Re: What's the point of -> ?

2013-03-12 Thread Laurent PETIT
2013/3/12 Dave Kincaid > Before long Clojure will have as much ugly, arcane syntax as Scala. (I say > that mostly tongue in cheek, btw). For me, a lot of the attractiveness of > Lisp languages is the minimal syntax that they have. I'm not a fan of > adding more to Clojure than is already there. I

Re: What's the point of -> ?

2013-03-12 Thread Marko Topolnik
On Tuesday, March 12, 2013 1:22:20 PM UTC+1, Dave Kincaid wrote: > Before long Clojure will have as much ugly, arcane syntax as Scala. (I say > that mostly tongue in cheek, btw). Clojure is way behind Scala on this score :) > For me, a lot of the attractiveness of Lisp languages is the minim

Re: Improving visibility of clojure-doc.org

2013-03-12 Thread Michael Klishin
2013/3/12 Devin Walters > I assume this has been discussed to death already, but isn't there some > way to get clojure-doc and clojuredocs to live under the same umbrella? > > We can host all relevant projects under the same GitHub org, that's a good idea. "Merging" two resources into one seems c

Re: What's the point of -> ?

2013-03-12 Thread Dave Kincaid
Before long Clojure will have as much ugly, arcane syntax as Scala. (I say that mostly tongue in cheek, btw). For me, a lot of the attractiveness of Lisp languages is the minimal syntax that they have. I'm not a fan of adding more to Clojure than is already there. I'm just one voice and a very

Re: Improving visibility of clojure-doc.org

2013-03-12 Thread Michael Klishin
2013/3/12 Robert Stuttaford > Has this effort started up yet? Is there a github url? > > I'd really love to see clojuredocs.org showing the 1.5 apis. Willing to > help make that happen! > I think the repos are https://github.com/dakrone/eisago https://github.com/dakrone/cadastre -- MK http://

Re: Improving visibility of clojure-doc.org

2013-03-12 Thread Michael Klishin
2013/3/12 Cedric Greevey > If one of those is that Clojure documentation site that has a paywall, I > object unless the merged site has no paywall. Official and > officially-endorsed documentation for open source software should not be > behind a paywall. Why don't you go to http://clojure-doc.

Re: Model-View-Controller in Clojure?

2013-03-12 Thread Jim - FooBar();
On 12/03/13 08:18, edw...@kenworthy.info wrote: (def current-live-cells (atom starting-live-cells)) (defn cells-changed ; called when current-live-cells changes [k r o n] (print "cells-changed called.")) (add-watch current-live-cells :log cells-changed) yes that is close...min

Re: What's the point of -> ?

2013-03-12 Thread Marko Topolnik
On Tuesday, March 12, 2013 10:54:35 AM UTC+1, Laurent PETIT wrote: > > or perhaps > > (-> response :body :postalCodes (->> (map to-location) (sort-by :city))) > > :-) > Yes, jumping to ->> in the middle of -> works; it fails the other way around. I was always frustrated by that asymmetry, hence

Re: What's the point of -> ?

2013-03-12 Thread Laurent PETIT
2013/3/12 Marko Topolnik > On Monday, March 11, 2013 11:51:17 PM UTC+1, Sean Corfield wrote: > >> In addition to clj-time, I tend to use -> with date-clj as well: >> >> (-> (today) >> (subtract 30 :days)) >> >> And I find something like this: >> >> (->> (-> response :body :postalCodes

Re: Get difference between two lists with java objects of same class

2013-03-12 Thread Michael Gardner
On Mar 12, 2013, at 04:11 , Marko Topolnik wrote: > This is almost exactly the same as the one from an earlier post here: > > (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a) > > I'd prefer remove to filter + complement, though. Ah, I should have read the rest of the thread more c

Re: Get difference between two lists with java objects of same class

2013-03-12 Thread Ryan
Thanks guys for your replies. I will re-read everything carefully and decide what to do :) Ryan On Tuesday, March 12, 2013 11:14:17 AM UTC+2, Marko Topolnik wrote: > > On Monday, March 11, 2013 11:09:31 PM UTC+1, Ryan wrote: > >> What if, i had two clojure lists, with hash-maps which have the sa

Re: Noobie question - sorry :)

2013-03-12 Thread Marko Topolnik
On Tuesday, March 12, 2013 8:59:47 AM UTC+1, edw...@kenworthy.info wrote: > So I do not understand why calling > > (defn evolve [] > (Thread/sleep 1000) > (print ".") > (recur)) > > Never results in anything being printed until I press Ctrl-C at which > point a bunch of . are printe

Re: Get difference between two lists with java objects of same class

2013-03-12 Thread Marko Topolnik
On Monday, March 11, 2013 11:09:31 PM UTC+1, Ryan wrote: > What if, i had two clojure lists, with hash-maps which have the same keys > and based on a specific key, i wanted to find the items from list-a which > do not exist in list-b. Would i go with the two functions you suggested or > is ther

Re: Get difference between two lists with java objects of same class

2013-03-12 Thread Marko Topolnik
> > Assuming :id is the key you care about: > >> (filter (comp (complement (set (map :id list-b))) :id) >> list-a) > > This is almost exactly the same as the one from an earlier post here: (remove (comp (into #{} (map key-fn list-b)) key-fn) list-a) I'd prefer *remove* to *filter + complem

Re: What's the point of -> ?

2013-03-12 Thread Marko Topolnik
On Monday, March 11, 2013 11:51:17 PM UTC+1, Sean Corfield wrote: > In addition to clj-time, I tend to use -> with date-clj as well: > > (-> (today) > (subtract 30 :days)) > > And I find something like this: > > (->> (-> response :body :postalCodes) > (map to-location

Re: Noobie question - sorry :)

2013-03-12 Thread edward
Thank you. -- -- 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 with your first post. To unsubscribe from this group, send

Re: Model-View-Controller in Clojure?

2013-03-12 Thread edward
So having parsed your log-history example Jim (which I found tricky because of the confusion of the problem domain in your example with the implementation, logging history versus watching changes is a bit close, and the gratuitous use of the threading macro). I think a simpler example would be:

Re: Model-View-Controller in Clojure?

2013-03-12 Thread edward
OK took me a while to work my way through your code. I think a simpler version to illustrate the point would be: (def current-live-cells (atom starting-live-cells)) (defn cells-changed ; called when current-live-cells changes [k r o n] (print "cells-changed called.") (repaint

Re: Noobie question - sorry :)

2013-03-12 Thread Laurent PETIT
2013/3/12 > So I do not understand why calling > > (defn evolve [] > (Thread/sleep 1000) > (print ".") > (recur)) > > Never results in anything being printed until I press Ctrl-C at which > point a bunch of . are printed. > > However if I remove (Thread/sleep 1000) then it works as

Re: Get difference between two lists with java objects of same class

2013-03-12 Thread Michael Gardner
On Mar 11, 2013, at 17:09 , Ryan wrote: > What if, i had two clojure lists, with hash-maps which have the same keys and > based on a specific key, i wanted to find the items from list-a which do not > exist in list-b. Would i go with the two functions you suggested or is there > something else

Noobie question - sorry :)

2013-03-12 Thread edward
So I do not understand why calling (defn evolve [] (Thread/sleep 1000) (print ".") (recur)) Never results in anything being printed until I press Ctrl-C at which point a bunch of . are printed. However if I remove (Thread/sleep 1000) then it works as I would expect. I thought (Th

Re: Improving visibility of clojure-doc.org

2013-03-12 Thread BJG145
It's quite confusing that http://clojure-doc.org and http://www.clojure-doc.org go to different pages. -- -- 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