Re: The Santa Claus Problem

2009-05-05 Thread Mark Engelberg
I think that part of the point of the Santa Claus problem is to keep everything carefully synchronized. The Erlang and Erlang-inspired solutions are all inherently asynchronous, which means that other threads may be able to observe inconsistencies in state. This problem is compounded if you allo

Re: Enlive questions

2009-05-05 Thread David Nolen
Seems to be working great now. On Wed, May 6, 2009 at 1:36 AM, Christophe Grand wrote: > > Hello Ryan, > > rzeze...@gmail.com a écrit : > > Either I've missed something, or Enlive *appears* to have problems > > handling comment tags. > > > Indeed. I pushed a fix, please tell me whether it works f

Re: Enlive questions

2009-05-05 Thread Christophe Grand
Hello Ryan, rzeze...@gmail.com a écrit : > Either I've missed something, or Enlive *appears* to have problems > handling comment tags. > Indeed. I pushed a fix, please tell me whether it works for you now. Thanks for the report. Christophe -- Professional: http://cgrand.net/ (fr) On Clojur

Re: Enlive questions

2009-05-05 Thread rzeze...@gmail.com
Either I've missed something, or Enlive *appears* to have problems handling comment tags. I was using Enlive against an already existing HTML file and kept getting the following exception (please note it is HTML 4.01 Strict and passed validation): java.lang.RuntimeException: java.lang.IllegalArg

Printing to REPL from other threads in Slime

2009-05-05 Thread Mark Engelberg
I'm using Clojure Box's Emacs/Slime setup. When I invoke println from a newly-spun thread, I don't see the output in the REPL. Suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post

seq-utils request

2009-05-05 Thread e
I notice (includes?) returns true. I also can't find a (position) function that would be like (.indexOf) Anybody else think it would be cool if (includes?) returned the position instead of just "true"? could it then return nil when not found? --~--~-~--~~~---~--~~

Re: Writer turned programmer seeks string processing advice

2009-05-05 Thread Stuart Sierra
Hi Dirk, welcome to Clojure! I don't know much about Scala, but I know that Lisp-like languages have long been popular for this sort of language manipulation, so Clojure may be a good one to look at. Some caveats: Clojure does not have a direct equivalent to the pattern/ template style of AIML.

Re: Writer turned programmer seeks string processing advice

2009-05-05 Thread Luke VanderHart
First of all, this is a very interesting question. I definitely wish I had more time to think about it and maybe put together some code - unfortunately I don't. Clojure does sound like it would be good for this kind of processing. This is an ideal example of where it would be incredibly powerful

Re: Help: Newbie question get contributed libraries to work

2009-05-05 Thread Stuart Sierra
On May 5, 1:20 pm, Leotis buchanan wrote: > Let say for example i decide to use the icanter > library(http://wiki.github.com/liebke/incanter), where should i place the > icanter > files so that clojure can see them. You can put them anywhere, but the top-level directory must be on the Java cla

Re: Help: Newbie question get contributed libraries to work

2009-05-05 Thread David Nolen
What environment are you using? VimClojure? Emacs+SLIME? I will say that Enclojure+NetBeans does make things really simple if you're just trying things out. David On Tue, May 5, 2009 at 1:20 PM, Leotis buchanan wrote: > Hey Guys, > > I am trying to use a few of the cool clojure contributed libr

Writer turned programmer seeks string processing advice

2009-05-05 Thread dhs827
Hi, my name is Dirk Scheuring, I'm a writer based in Cologne, Germany, and I want to write something about AI that can only be expressed by using AI technology and technique. You could say that what I aim for is a chatbot, but it's a bot that works quiet different from the norm; at it's core, the

Re: Help: Newbie question get contributed libraries to work

2009-05-05 Thread Leotis buchanan
Hey Guys, I am trying to use a few of the cool clojure contributed libraries, but it seems i am not placing the libraries files in the directory where clojure expects to find them. Let say for example i decide to use the icanter library( http://wiki.github.com/liebke/incanter), where should i pl

Re: The Santa Claus Problem

2009-05-05 Thread Meikel Brandmeyer
Hi, I'm not very familiar with the concurrent features of Clojure myself. So I can't really comment on your solution. I tried to solve the problem myself, though. So here is my try: http://paste.pocoo.org/show/115929 My solution to the "prefer reindeers" problem is a global atom *preparing*. Whi

RESOLVED: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
Yeah, it was a classpath error. I had to create the following dummy object: com.sap.jdsr.writer.DsrIPassport Once I did that and added it to the classpath, I was golden. Turns out this is a known error with SAP JCo Thanks everyone! On May 5, 1:49 pm, Sean Devlin wrote: > Another great i

Re: Clojure 1.0

2009-05-05 Thread liebke
Congratulations to Rich and all the contributors! It has been a joy to program in Clojure, it is the Lisp I've been waiting for. Thank you, David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To p

Re: clojure.contrib.test-is/run-tests throws NullPointerException w/ invalid args

2009-05-05 Thread Stuart Sierra
On May 5, 2:05 pm, Timo Mihaljov wrote: > When clojure.contrib.test-is/run-tests is given an invalid argument, it > throws a NullPointerException: Yes, I'm aware of this, will try to fix. -SS --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Got a Clojure user group?

2009-05-05 Thread Paul Stadig
I manage the Clojure Users Group on LinkedIn, which might also be worth mentioning. http://www.linkedin.com/groups?gid=1058217 Paul On Thu, Apr 23, 2009 at 9:43 PM, Rich Hickey wrote: > > Thanks all - the list is here: > > http://clojure.org/community > > More additions welcome! > > Rich > >

clojure.contrib.test-is/run-tests throws NullPointerException w/ invalid args

2009-05-05 Thread Timo Mihaljov
When clojure.contrib.test-is/run-tests is given an invalid argument, it throws a NullPointerException: user=> (use 'clojure.contrib.test-is) nil user=> (run-tests 'asdf) java.lang.RuntimeException: java.lang.NullPointerException (NO_SOURCE_FILE:0) The issue seems harmless in a simple case like

Re: Help: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
Another great idea. Following this technique, the Java code executed perfectly when called from Clojure. Time to check my configuration again. Thanks for the tip! On May 5, 12:59 pm, Adrian Cuthbertson wrote: > Perhaps you could try calling your java class directly from the repl... > > (Tutori

Re: Help: Java code works, Clojure code doesn't

2009-05-05 Thread Adrian Cuthbertson
Perhaps you could try calling your java class directly from the repl... (TutorialConnect1.) That might highlight the problem - your java stack strace might give some clues. It does sound like a classpath problem of some sort. Rgds, Adrian. On Tue, May 5, 2009 at 6:04 PM, Sean Devlin wrote: >

Re: Help: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
That's a really good point, thanks for mentioning. Unfortunately, after looking into this, it's not the culprit. The java code's classpath is a _subset_ of the clojure code's classpath. Also, the DsrIPassport class doesn't exist. It was depricated years ago... The Clojure code appears to be i

Re: Help: Java code works, Clojure code doesn't

2009-05-05 Thread David Chamberlin
It sounds like you maybe haven't included all the necessary stuff in your classpath. If you are testing in REPL, then you need to include everything you need in the classpath the the invoked JVM, for example: java -classpath my-jar-file-containing-DsrlPassport.jar;clojure.jar clojure.main On

Re: Method overloading & proxy method

2009-05-05 Thread Stuart Sierra
On May 4, 11:52 pm, Alex Osborne wrote: > Thankfully, Mark managed to figure out a way of doing it with with gen- > class by using an undocumented (?) feature where you can put types > into the method names so as to pick the exact one you want to > override: > > (ns org.example.FancyInputStream >

Help: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
Okay, I've got code that works in Java but I can't get working in Clojure. Here's the code in Java public class TutorialConnect1 extends Object { JCO.Client mConnection; public TutorialConnect1() { try { // Change the logon information to your own system/user mConnection = JC

Re: Clojure 1.0

2009-05-05 Thread tmountain
I've submitted the announcement to Slashdot. It's in the firehose right now. If anyone has an account, you can go vote for the submission and perhaps we can get it on the front page. http://slashdot.org/firehose.pl - article titled "Clojure 1.0 Released" Travis On May 4, 10:56 pm, Mikio Hokari

Re: constructing maps

2009-05-05 Thread Nathan Hawkins
On Tue, 05 May 2009 09:39:21 +0200 Christophe Grand wrote: > > Kevin Downey a écrit : > > (into {} (apply map vector > > '((cars bmw chevrolet ford peugeot) > > (genres adventure horror mystery > > > > {ford mystery, chevrolet horror, bmw adventure, cars ge

Symbol macros and local macros

2009-05-05 Thread Konrad Hinsen
I just added a new library to clojure.contrib: clojure.contrib.macro- utils. It provides three macros that are useful in writing other macros: - macrolet (syntax like letfn) provides local macros that are active only inside the body of the macrolet form. - symbol-macrolet provides local symbo

Re: Feedback on new persistentmatrix datatype

2009-05-05 Thread aperotte
It's compatible with other libraries to varying degrees. The internal data stored in a linear array. As with most things, we could probably coerce the datatype into compatibility with any java library, but how efficient things will be would vary. It would definitely be great to see integration

Re: Feedback on new persistentmatrix datatype

2009-05-05 Thread Konrad Hinsen
On May 3, 2009, at 0:19, aperotte wrote: > I just uploaded some of my work on a new datatype for clojure to a git > repository. > > http://github.com/aperotte/persistentmatrix > > A bit of the rationale and motivation for the datatype is described on > the github page. I basically wanted to crea

Re: Got a Clojure library?

2009-05-05 Thread Konrad Hinsen
On Jan 29, 2009, at 16:04, Rich Hickey wrote: > I'd like to try to get a directory of Clojure libs together and up on > the Clojure site. Towards that end, I'd appreciate it, if you are the > author of a Clojure library (including contrib authors!), you reply in > this thread with: ... Name: c

Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-05 Thread Rick Moynihan
Yesterday I noticed that the github mirror I'd been using at: http://github.com/kevinoneill/clojure/tree/master Does not appear to be fully mirroring clojure's SVN repository, as it only appears to mirror the trunk. This means that the branches and more importantly the 1.0 tag are not being mir

Re: Clojure 1.0

2009-05-05 Thread Neo
Congratulations to Rich and the whole community. It's a fantastic time. Cheers! On May 4, 8:58 pm, Rich Hickey wrote: > After a sustained period of API stability and minimal bugs reports, > I'm happy to announce the release of Clojure 1.0! > > http://clojure.googlecode.com/files/clojure_1.0.0.zi

Re: Clojure 1.0

2009-05-05 Thread Mikio Hokari
Congratulations! I'm loving and enjoying Clojure programming. Clojure is the most beautiful, practical and fun language I've ever seen. Thank you very much for your great work! Mikio 2009/5/5 tmountain : > > Congrats! I'm loving Clojure more all the time. Thank you for making > the Lisp I've bee

Re: Method overloading & proxy method

2009-05-05 Thread Alex Osborne
On Mar 23, 9:55 am, ronen wrote: > [... what] I actually need is a way of overriding specific methods (like the > visit > (MethodDeclaration n, A arg) and not all of them. I keep running into this problem again and again myself, so I thought I might post some notes. The short of it: doing anyt

Re: ANN: Full, continuously updated documentation for clojure.contrib

2009-05-05 Thread Antony Blakey
On 05/05/2009, at 1:53 AM, Tom Faulhaber wrote: > Antony: There is a way for authors to add links either to other pages > in the wiki or externally. See DataLog and Monad for examples of how > this works. One of the issues here is that doc strings are repurposed > in a lot of ways and authors ge

The Santa Claus Problem

2009-05-05 Thread graham
I thought this problem (described here http://www.cs.otago.ac.nz/staffpriv/ok/santa/) was nifty back when I first encountered Erlang and as a learning exercise I wanted to model something similar in Clojure. I tried to follow the Erlang solution described in the link (http:// www.cs.otago.ac.nz/

Re: constructing maps

2009-05-05 Thread Christophe Grand
Kevin Downey a écrit : > (into {} (apply map vector > '((cars bmw chevrolet ford peugeot) > (genres adventure horror mystery > > {ford mystery, chevrolet horror, bmw adventure, cars genres} > or: user=> (apply zipmap '((cars bmw chevrolet ford peugeot) (ge