Re: 1.2 contrib shuffles

2010-08-30 Thread Michael Jaaka
I downloaded Clojure Contrib Stable 1.2 from http://github.com/downloads/clojure/clojure-contrib/clojure-contrib-1.2.0.zip And builded with mvn package. The results are: Testing clojure.contrib.test-io FAIL in (test-as-url) (test_io.clj:21) expected: (= (URL. file:/foo) (as-url (File. /foo)))

Re: 1.2 contrib shuffles

2010-08-30 Thread Daniel Janus
On 28 Sie, 07:00, Stuart Sierra the.stuart.sie...@gmail.com wrote: On Aug 27, 3:42 pm, B Smith-Mannschott bsmith.o...@gmail.com wrote: This thread got me thinking that when a namespace is partially promoted to Clojure proper, it might be good to provide a reduced version of the old

Problem reloading source file with imports

2010-08-30 Thread Chris Jenkins
Since I switched to Clojure 1.2, I see an error message whenever I try to reload a source file that imports anything. The error message is of the form already refers to xxx, as though it is complaining that it can't import the same thing twice. For example, I have a minimal source file that

Re: NullPointerExecption after Java class import

2010-08-30 Thread zm
Indeed if exception is thrown in static initializer block then clojure import throws exception as well. The following class will cause this: package aaa; public class Test { static{ Object o = null; o.toString(); } } Then in clojure: (ns x

Re: Problem reloading source file with imports

2010-08-30 Thread Robert McIntyre
Yeah, they changed that from clojure 1.1 and it's really annoying --- as far as I know, your only options right now are to either select exactly which functions from seq-utils you want using the :only keyword, or if you really want to use the seq-utils version you can use refer-clojure and the

Re: Is it possible in theory to write/modify a Clojure compiler that doesn't

2010-08-30 Thread Matt Fowles
All~ There was a presentation at the JVM language summit about this exact topic. http://wiki.jvmlangsummit.com/Mixed_language_project_compilation_in_Eclipse:_Java_and_Groovy http://wiki.jvmlangsummit.com/Mixed_language_project_compilation_in_Eclipse:_Java_and_GroovyIn fact, the person was

clojure and jogl and jReality

2010-08-30 Thread Sunil Nandihalli
Hello everybody, I am trying to get a simple java code (about 10 lines in clojure ) which uses jReality ported to clojure. This is my attempt has been kind of half way successfull. The corresponding github-repo link is git://github.com/sunilnandihalli/jRealityTutorial.git The project is

defrecord issue in unit tests

2010-08-30 Thread garf
I am getting the following error when I switched from defstruct to defrecord **Unable to resolve classname: Rule-record (RecordInitTest.clj:8)** I only have this problem when definition usage is split between two files, i.e. let first file contain: (ns RecordInitQuest) (defrecord Rule-record

clojure and jogl and jReality

2010-08-30 Thread Sunil S Nandihalli
Hello everybody, I am trying to get a simple java code (about 10 lines in clojure ) which uses jReality ported to clojure. This is my attempt has been kind of half way successfull. The corresponding github-repo link is git://github.com/sunilnandihalli/jRealityTutorial.git The project is

trouble with NetBeans install

2010-08-30 Thread Stuart Halloway
A student in the upcoming Clojure Studio is reporting the following problem getting started with NetBeans. Any suggestions? Some plugins require plugin Common Scripting Language API (new) to be installed. The plugin Common Scripting Language API (new) is requested in version =

Re: What is the reason Lisp code is not written with closing parenthesis on new lines?

2010-08-30 Thread michele
Being the one who asked the question and satisfied with the answers, I agree. I never expected a question like this, about one of the oldest programming languages, to generate so many responses and discussions. Funny... On Aug 29, 9:46 pm, lprefonta...@softaddicts.ca wrote: My rough estimate

Re: clojure and jogl and jReality

2010-08-30 Thread David Nolen
On Mon, Aug 30, 2010 at 5:42 AM, Sunil Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I am trying to get a simple java code (about 10 lines in clojure ) which uses jReality ported to clojure. This is my attempt has been kind of half way successfull. The corresponding

Re: Is it possible in theory to write/modify a Clojure compiler that doesn't

2010-08-30 Thread Luke VanderHart
Robert, The only problem with this approach is that there ARE practically guaranteed to be circular references. If the goal is to compile Clojure as if it were Java, circular references must be accounted for. But dependencies on classes generated based on parsing bytecode... that seems a pretty

Re: NullPointerExecption after Java class import

2010-08-30 Thread zm
Initialization exception can be avoided if Factory class is initialized indirectly: (let [factory (.newInstance (Class/forName gate.Factory))] ...) The problem is that Factory can only be initialized (its static fields) after Gate.init was called. But clojure reader (or what it is) initializes

Re: Problem reloading source file with imports

2010-08-30 Thread Chris Jenkins
How would using the :only keyword help here? Just to be clear, the problem here is that attempting to load my source file the second time fails (loading the first time having succeeded, albeit with a few warnings about replacing symbols from clojure.core), which makes it very difficult for me to

Re: Problem reloading source file with imports

2010-08-30 Thread Meikel Brandmeyer
Hi, Am 30.08.2010 um 20:43 schrieb Chris Jenkins: How would using the :only keyword help here? Just to be clear, the problem here is that attempting to load my source file the second time fails (loading the first time having succeeded, albeit with a few warnings about replacing symbols

Re: Problem reloading source file with imports

2010-08-30 Thread Phil Hagelberg
On Mon, Aug 30, 2010 at 3:05 AM, Robert McIntyre r...@mit.edu wrote: Yeah, they changed that from clojure 1.1 and it's really annoying --- as far as I know, your only options right now are to either select exactly which functions from seq-utils you want using the :only keyword, or if you

Help speed up an inner loop?

2010-08-30 Thread tsuraan
Just to try to see if clojure is a practical language for doing byte-level work (parsing files, network streams, etc), I wrote a trivial function to iterate through a buffer of bytes and count all the newlines that it sees. For my testing, I've written a C version, a Java version, and a Clojure

Re: Problem reloading source file with imports

2010-08-30 Thread Chris Jenkins
Thanks for the pointers you guys. I changed my code to this: (ns test.core (:use [clojure.contrib.seq :only (indexed)])) ... (indexed being the function that I was interested in) and it now works ok. I can reload the file as many times as I like. I must confess that I am rather confused by

Somnium.congomongo missing contribs json

2010-08-30 Thread Linus Ericsson
I have problems loading somnium.congomongo. My Leiningen project.clj looks like this: (defproject system1 0.1.0 :description System1 :dependencies [ [org.clojure/clojure 1.2.0-master-SNAPSHOT] [org.clojure/clojure-contrib 1.2.0-SNAPSHOT]

Is nil a compile-time literal?

2010-08-30 Thread Paul Mooser
I was surprised today when using nil as the test value for one of the clauses of the new 1.2 case statement that it results in an NPE. Is this a bug, or intended behavior? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Somnium.congomongo missing contribs json

2010-08-30 Thread Miki
Try using [congomongo 0.1.3-SNAPSHOT] in project.clj. Works for me with 1.2. On Aug 30, 1:37 pm, Linus Ericsson oscarlinuserics...@gmail.com wrote: I have problems loading somnium.congomongo. My Leiningen project.clj looks like this: (defproject system1 0.1.0   :description System1  

Re: trouble with NetBeans install

2010-08-30 Thread Mark Nutter
This may or may not be related, but I had similar problems when I tried to install from the downloadable .nbm file for enclojure. I solved it by poking around the enclojure.org site -- there's instructions for updating the plugins setup screen so that you can install/update enclojure using the

Re: trouble with NetBeans install

2010-08-30 Thread gary ng
On Mon, Aug 30, 2010 at 3:57 PM, Mark Nutter manutte...@gmail.com wrote: This may or may not be related, but I had similar problems when I tried to install from the downloadable .nbm file for enclojure. I solved it by poking around the enclojure.org site -- there's instructions for updating

Re: Extending Clojure's STM with external transactions

2010-08-30 Thread nchubrich
I'm not aware of any, but +1 for seeing persistence handled as part of the language. A big project and a long-term one, to be sure, but could it not be considered a goal? In my student days, I was talking to a well-known Lisper (name suppressed for fear of Google indexing) about some data

Re: Help speed up an inner loop?

2010-08-30 Thread Robert McIntyre
I don't know what the heck is going here, but ignore the time the program is reporting and just pay attention to how long it actually takes wall-clock style and you'll see that your clojure and java programs already take the same time. Here are my findings: I saved Iterate.java into my rlm

Re: Problem reloading source file with imports

2010-08-30 Thread Robert McIntyre
Sorry, I was tired and didn't explain very well. Right now you have a naked (:use clojure.contrib.seq-utils) somewhere. You want to use partition-by, but that's already in core, so you might just get rid of the :use altogether. But maybe there are some other functions in seq-utils that you do

Minor macroexpand issue

2010-08-30 Thread Frederic Koehler
I accidentally noticed this: On clojure 1.2, macroexpanding with a function name which is a class, causes this ugly error: (macroexpand '(Object)) java.lang.Exception: Expecting var, but Object is mapped to class java.lang.Object (repl-1:2) when presumably it should just give '(Object). I

Re: Is nil a compile-time literal?

2010-08-30 Thread Stuart Sierra
case does constant-time dispatch using the hash codes of the test values. Since nil is Java null, it doesn't have a hash code, so case can't handle it. I wouldn't call it a bug, but there is work to be done on extending case to edge cases like this. -S On Aug 30, 5:07 pm, Paul Mooser

Re: Help speed up an inner loop?

2010-08-30 Thread Alan
I think this misses the point. Of course java, c, and clojure will all have roughly the same wall-clock time for this program, since it is dominated by the I/O. You can even see that in the output from $ time java Iterate: less than 0.5s was spent in user space, the rest was spent in system code -

Re: Is nil a compile-time literal?

2010-08-30 Thread Alan
That was my first thought too, but (hash nil) is zero. So it doesn't seem like it should be caused by that problem. I'm not familiar enough with the internals of clojure.core to follow all of the stuff going on in (source case), but it seems to be using (hash x) rather than (. x hashCode). And

Re: Problem reloading source file with imports

2010-08-30 Thread John Sanda
I ran into the same situation as Chris yesterday with clojure.contrib.seq-utils as well as with clojure.contrib.str-utils. The explanation is very timely for me and much appreciated. - John On Mon, Aug 30, 2010 at 4:05 PM, Robert McIntyre r...@mit.edu wrote: Sorry, I was tired and didn't