Re: Funding Clojure 2010

2010-01-15 Thread Mark Derricutt
Paypal can be setup for reoccuring payments. I know I do that with DropBox - not sure how one sets that up thou... -- Pull me down under... On Fri, Jan 15, 2010 at 6:29 PM, Brian Goslinga wrote: > I think it would be useful if there was some way to (mostly) > automatically donate $10/month. --

aot defprotocol for java interop?

2010-01-15 Thread Raoul Duke
hi, anybody have a simple example of compiling a protocol + using it from java? i'm not having luck getting anything working yet. thanks. -- 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 No

Re: Cond, and abusing or

2010-01-15 Thread Scott Burson
On Jan 15, 2:02 pm, Simon Brooke wrote: > There's an old programmers hack that works in many languages of > abusing the logical or operator to try a sequence of operations until > one returns something useful. It appears that this works in Clojure, > too. Certainly, this is a very common idiom in

Re: Cond, and abusing or

2010-01-15 Thread Rich Hickey
On Jan 15, 5:02 pm, Simon Brooke wrote: > There's an old programmers hack that works in many languages of > abusing the logical or operator to try a sequence of operations until > one returns something useful. It appears that this works in Clojure, > too. > > The reason I tried it is that I'm un

Cond, and abusing or

2010-01-15 Thread Simon Brooke
There's an old programmers hack that works in many languages of abusing the logical or operator to try a sequence of operations until one returns something useful. It appears that this works in Clojure, too. The reason I tried it is that I'm unhappy with Clojure's implementation of cond. Consider

Re: clojure unicode on Windows

2010-01-15 Thread Kevin Downey
are you using the repl directly? or wrapped in jline or rlwrap? On Wed, Jan 13, 2010 at 3:02 PM, Lukas Lehner wrote: > Ok, tried to put this at the top of the file, but same bad result on Win > (System/setProperty "file.encoding"  "UTF8") > > and actually here > http://stackoverflow.com/questions

Clojure on Ideone!

2010-01-15 Thread sphere research
Hi, test Clojure on ideone.com (more: http://www.facebook.com/pages/ideone/245768360841) see the example: http://ideone.com/Aymq9Tg4 if you wish, we could install Clojure on spoj.pl, regards, Ideone&SPOJ Team -- You received this message because you are subscribed to the Google Groups "Clojur

Re: mutability, threads, state and idiom

2010-01-15 Thread Simon Brooke
On 15 Jan, 17:40, Laurent PETIT wrote: > Simon, > > To be very clear, and incite you to watch all those videos and read > all this material: > > One of the key motivations (if not the primary) of Rich writing > clojure has been constructing a language which would offer built-in > semantics to mana

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-15 Thread Constantine Vetoshev
On Jan 15, 5:59 am, Laurent PETIT wrote: > I would like to know, is there an essential reason for not having > stored the dependency graph as a hidden property of the graph ? I'm not sure I understand your question. You can see the stored graph if you take the function returned by dg/make-dgraph

Re: Lazy recursive walk.

2010-01-15 Thread Nicolas Buduroi
On Jan 15, 3:25 pm, Sean Devlin wrote: > Did you try wrapping everything w/ a call to lazy-seq? Yes, it doesn't seem change anything. -- 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

Re: Lazy recursive walk.

2010-01-15 Thread Sean Devlin
Did you try wrapping everything w/ a call to lazy-seq? On Jan 15, 3:21 pm, Nicolas Buduroi wrote: > Hi, I'm still not familiar with laziness and I'm trying to make a > function recursively walk arbitrary data structures to perform some > action on all strings. The non-lazy version is quite easy t

Lazy recursive walk.

2010-01-15 Thread Nicolas Buduroi
Hi, I'm still not familiar with laziness and I'm trying to make a function recursively walk arbitrary data structures to perform some action on all strings. The non-lazy version is quite easy to do: (use 'clojure.walk 'clojure.contrib.str-utils) (defn recursive-string-walk [f form] (walk #(

Re: mutability, threads, state and idiom

2010-01-15 Thread Raoul Duke
On Fri, Jan 15, 2010 at 7:58 AM, ataggart wrote: > And a neat series showing how games which look imperative can be bent > to be (mostly) functional: > http://prog21.dadgum.com/23.html i find it interesting that there are so many drastically different approaches cf. http://world.cs.brown.edu/ si

Re: Question about seq

2010-01-15 Thread Stephen C. Gilardi
On Jan 15, 2010, at 4:01 AM, Stephen C. Gilardi wrote: > On Jan 15, 2010, at 3:26 AM, Sean Devlin wrote: > >> user=> (seq []) >> nil >> >> Why is nil returned, instead of an empty sequence? > > There is no such thing as an empty seq. This was true at one time, but isn't true after the changes

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-15 Thread Constantine Vetoshev
On Jan 14, 7:29 pm, Timothy Pratley wrote: > To give me a > head-start, are there key differences with clojure.contrib.dataflow so > I can better understand? Thank you for your interest. I have not extensively used c.c.dataflow, so I apologize if I misrepresent it, but here are some key differenc

Re: mutability, threads, state and idiom

2010-01-15 Thread Laurent PETIT
Simon, To be very clear, and incite you to watch all those videos and read all this material: One of the key motivations (if not the primary) of Rich writing clojure has been constructing a language which would offer built-in semantics to manage state change over time. So you're really in the ri

Re: Many foolish questions

2010-01-15 Thread Rayne
Ignore this. ;) deftype and reify and all of that good stuff are now in the Clojure master branch. Rich pulled new into master a few days ago. On Jan 15, 4:09 am, Michael Wood wrote: > 2010/1/15 Simon Brooke : > > > > > OK, I'm trying to get seriously stuck in, and the first thing I'm > > trying

Re: mutability, threads, state and idiom

2010-01-15 Thread ataggart
Also check out Rich's video covering concurrency, and in particular his Ants program: http://blip.tv/file/812787 For more on state stuff: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey And a neat series showing how games which look imperative can be bent to be (mostly) functional

Re: mutability, threads, state and idiom

2010-01-15 Thread Meikel Brandmeyer
Hi, On Jan 15, 4:25 pm, Simon Brooke wrote: > Right, I'm trying to get my head around the consequences of > Opinions? You have to distinguish between identity and state. Disclaimer: I have no clue whatsoever about game design. The different rooms are identities, the different players are iden

Re: mutability, threads, state and idiom

2010-01-15 Thread ataggart
On Jan 15, 7:25 am, Simon Brooke wrote: > So, there seem to be four possibilities > > (1) I've chosen the wrong language for the problem, or vice versa; > (2) There is some idiomatic means of managing mutable state which I've > missed; > (3) The right solution is to create a hybrid system using

[im]mutability, threads, state and idiom

2010-01-15 Thread Simon Brooke
Right, I'm trying to get my head around the consequences of immutability for the sort of programming practices I'm used to, and how I change the way I do things to fit in with it. Initially I thought 'well, immutability just means you can't use rplaca and rplacd, and I've very rarely used either so

Why is (shutdown-agents) not used and explained more in Clojure concurrency examples

2010-01-15 Thread ggras
Hi, I am learning Clojure for some weeks now and i've just started playing around with threads. But as soon as i used threads in a clojure script the program had a 60 seconds period of doing nothing after the script completed and before it returned to the command prompt or Slime REPL prompt. I as

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-15 Thread Laurent PETIT
2010/1/15 Constantine Vetoshev : > I would like to announce the release of dgraph 1.0, a dependency graph > implementation for Clojure. > > http://github.com/gcv/dgraph > > dgraph provides a mostly pure functional data structure whose nodes > behave like cells in a spreadsheet. Data changes in stor

Re: Many foolish questions

2010-01-15 Thread Michael Wood
2010/1/15 Simon Brooke : > OK, I'm trying to get seriously stuck in, and the first thing I'm > trying to do is reimplement an inference engine I first wrote in > Portable Standard Lisp and then in InterLisp-D in /idiomatic/ Clojure. > So please have patience with me... > > If one has something whic

Re: Question about seq

2010-01-15 Thread Adrian Cuthbertson
Hi Sean, The background to this lies in the implementation of lazy sequences - seq returns an implementation of ISeq for the data structure in question - nil when there are no elements in the structure. Have a look at http://clojure.org/sequences and also http://clojure.org/lazy which gives the fu

Re: Question about seq

2010-01-15 Thread Stephen C. Gilardi
On Jan 15, 2010, at 3:26 AM, Sean Devlin wrote: > user=> (seq []) > nil > > Why is nil returned, instead of an empty sequence? It's fundamental to Clojure's seq abstraction that every seq has a first. There is no such thing as an empty seq. If you call the seq function on an empty collection,

Re: Question about seq

2010-01-15 Thread Laurent PETIT
Hey, I guess because a sequence is not a datastructure. If there is nothing to iterate over via 'first or 'next, then it's nil. And an "empty sequence" is precisely that: nil. In my point of view, a sequence is more like a "functional iterator": calling first on it will always return the same va

Question about seq

2010-01-15 Thread Sean Devlin
Hey everyone, I was working with seq today, and I was wondering why I got a certain result. user=> (seq []) nil Why is nil returned, instead of an empty sequence? Sean -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: classpath in clojure box

2010-01-15 Thread brian
ok i see it Brian Shawn Hoover wrote: On Thu, Jan 14, 2010 at 3:17 AM, brian > wrote: The above didn't work, but apparently it doesn't pick up my .emacs file, which has (setq swank-clojure-classpath (list "c:/shcloj-code/code/examples")) itkn