Re: Problem with running clojure on java.

2009-07-13 Thread Richard Newman
Manoj, require is for Clojure libraries only. You probably want import: http://clojure.org/api#toc297 but note that you don't need to *load* Java libraries per se, so long as they're in the classpath: import simply makes the names available in the current namespace. You can see this for y

Problem with running clojure on java.

2009-07-13 Thread mmwaikar
Hi, I am basically a .Net programmer, trying out Clojure on both java and .net. I have the following bat file, which I use to run Clojure - java -cp "C:\Program Files\Java\jdk1.6.0_13\jre\lib\rt.jar";D:\Manoj \Languages\Clojure\clojure\clojure-contrib.jar;D:\Manoj\Languages \Clojure\clojure\cloj

Re: Compilation troubles...

2009-07-13 Thread Jonathan Smith
On Jul 13, 5:51 pm, Morgan Allen wrote: > > It's definitely not necessary to implement the bulk of your code in Java to > > get performance. On the other hand, getting performance out of Clojure can > > be tricky. > > Well, yeah, that's the thing- getting maximal performance out of > clojure se

Re: Why this macro fails??

2009-07-13 Thread Stephen C. Gilardi
On Jul 13, 2009, at 10:26 PM, sailormoo...@gmail.com wrote: user=> (try (Integer/parseInt "x") (catch Exception _ 0)) 0 user=> (defmacro parse-int [a default] `(try (Integer/parseInt ~a) (catch Except ion _ ~default))) #'user/parse-int user=> (parse-int "x" 0) java.lang.Exception: Can't bind qu

Can anyone help getting Enclojure to work?

2009-07-13 Thread bruceq
I am having problems getting Enclojure to work properly on Netbeans 6.7 and also trying 6.5 Project REPL seems to work fine. Most commands such as evaluate expression throw like this. java.lang.NullPointerException at org.enclojure.ide.navigator.token_nav $get_namespace_node__408.invoke

Can anyone help getting Enclojure to work?

2009-07-13 Thread bruceq
I have installed Netbeans 6.7 and Enclojure plugin. I can make a project REPL and it woks OK. When I try to evaluate an expression in my source file (clt-L) I get an exception like this. java.lang.NullPointerException at org.enclojure.ide.navigator.token_nav $get_namespace_node__408.invok

Why this macro fails??

2009-07-13 Thread sailormoo...@gmail.com
user=> (try (Integer/parseInt "x") (catch Exception _ 0)) 0 user=> (defmacro parse-int [a default] `(try (Integer/parseInt ~a) (catch Except ion _ ~default))) #'user/parse-int user=> (parse-int "x" 0) java.lang.Exception: Can't bind qualified name:user/_ (NO_SOURCE_FILE: 0) --~--~-~--~

Re: surprising behaviour with do, ns and def

2009-07-13 Thread Stuart Sierra
On Jul 13, 3:58 pm, Chris Kent wrote: > user=> (ns a) (def foo "foo") > a=> #'a/foo > a=> > > If the same code is executed inside a do form the var is defined in > the original namespace.  I thought that the do should make no > difference.  Is this the intended behaviour? > > user=> (do (ns a) (d

Re: Clojure vectors

2009-07-13 Thread stephaner
Hi Instead of: (conj (drop-last 1 [1 2 3]) 4) You could use into []: (conj (into [] (drop-last 1 [1 2 3])) 4) [1 2 4] Stephane _/) On Jul 13, 11:15 am, Jan Rychter wrote: > I've been trying to implement stacks using vectors in Clojure. In case > you wonder why, it's because I need stacks w

Re: Clojure vectors

2009-07-13 Thread Rob
On Jul 13, 11:15 am, Jan Rychter wrote: > I've been trying to implement stacks using vectors in Clojure. In case > you wonder why, it's because I need stacks with a fast item count > operation. If that's the only reason, you don't have to use vectors. The following page says that 'count' for

Re: Compilation troubles...

2009-07-13 Thread Morgan Allen
> It's definitely not necessary to implement the bulk of your code in Java to > get performance. On the other hand, getting performance out of Clojure can > be tricky. Well, yeah, that's the thing- getting maximal performance out of clojure seems to require a degree of expertise and patience tha

Re: Compilation troubles...

2009-07-13 Thread John Harrop
On Mon, Jul 13, 2009 at 3:11 PM, Morgan Allen wrote: > It's a shame about the lack of official support for java-side > invocation- the bulk of my code is still implemented in java (largely > for efficiency reasons), so it would be handy to be able to initiate > things largely from that side. It

Re: Penumbra, a new set of OpenGL bindings

2009-07-13 Thread ztellman
Thanks for reminding me. I'll add Eclipse Public License disclaimers tonight. On Jul 6, 10:34 pm, Glen Stampoultzis wrote: > 2009/7/1 ztellman > > > > > > > > > Most of the OpenGL code I've seen has been a fairly literal > > translation of the corresponding Java, so as a way of getting my feet

Re: openlg

2009-07-13 Thread ztellman
Hi Emeka, I'm glad you're interested in my library. You're welcome to use it, and I'd be happy to answer any questions you have. I should warn you that it's still very rough, and I'm changing things around on a regular basis. I can't guarantee that any program you write against the current ver

Re: classloaders, modularity, packaging

2009-07-13 Thread Daniel
On Mon, Jul 13, 2009 at 8:40 PM, Stuart Sierra wrote: > > Hi folks, > I agreed to talk about Clojure at Philly Lambda on July 21st.  I'm > working on a presentation about modularity -- packaging, library > management, ClassLoaders, that sort of thing.  I want to cover some of > the popular library

Re: openlg

2009-07-13 Thread Daniel
On Tue, Jul 14, 2009 at 1:09 AM, Emeka wrote: > Hello All, ztellman, > > I would like to use  git://github.com/ztellman/penumbra.git , however I > won't mind knowing the owner, too. If you create an account on github.com you can send him a message directly. Cheers, Daniel --~--~-~--~---

Re: Confusion on Clojure 1.0, compatible clojure-contrib, git-hub, svn, ...

2009-07-13 Thread Cosmin Stejerean
On Mon, Jul 6, 2009 at 2:59 PM, Laurent PETIT wrote: > > I think there could be a way to make both parts happy : rather than > just adding the info that it is an old repo in some README file in the > root directory of the svn repo, committing also an svn delete command > on all the contents of tru

surprising behaviour with do, ns and def

2009-07-13 Thread Chris Kent
I've noticed that changing namespace with ns and then doing a def doesn't behave the same inside a do form: Without the do form it works as expected: user=> (ns a) (def foo "foo") nil a=> #'a/foo a=> If the same code is executed inside a do form the var is defined in the original namespace. I

Re: Compilation troubles...

2009-07-13 Thread Rayne
Hrm, I've never found it all that hard to type "ant" when I want my code compiled. :p I will admit, when I first used ant, I was scared to death because of stuff I had heard about it. I actually had fun using it. On Jul 13, 2:11 pm, Morgan Allen wrote: > > OK, cool. That is another benefit of A

Re: Compilation troubles...

2009-07-13 Thread Morgan Allen
> OK, cool. That is another benefit of AOT compilation. The primary use   > for :gen-class is when the Java side needs a class it can refer to   > explicitly by name. For other cases, a good way for Java to   > communicate with Clojure code is to use a proxy. On the Java side, you   > can define

openlg

2009-07-13 Thread Emeka
Hello All, ztellman, I would like to use git://github.com/ztellman/penumbra.git , however I won't mind knowing the owner, too. Regards, Emeka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Bug with struct-maps and *print-dup*

2009-07-13 Thread Chouser
On Mon, Jul 13, 2009 at 1:25 PM, Mark Engelberg wrote: > > Thanks for confirming the bug that struct-maps written with > *print-dup* bound to true cannot be read back in.  So is this a bug > with the writer or the reader, or with the create method of struct > maps, or something else? This is a kn

Re: Bug with struct-maps and *print-dup*

2009-07-13 Thread Mark Engelberg
On Fri, Jul 10, 2009 at 6:52 AM, J. McConnell wrote: > > On Thu, Jul 9, 2009 at 11:31 PM, Mark Engelberg > wrote: >> >> I'm running Clojure 1.0. >> >> Could someone please check and see whether this is still a bug in the >> most current version? > > Yup, I still see the same behavior in HEAD. > >

Clojure 1.0.0 has been uploaded to Maven Central - Finally

2009-07-13 Thread Stefan Hübner
Hi all, just a quick update on the Maven bundle: it has finally been uploaded and is available for your Maven based projects as org.clojure:clojure:1.0.0:jar (groupId, artifactId, version, type). Thanks for all voters! -Stefan Hübner --~--~-~--~~~---~--~~ You re

Re: Compilation troubles...

2009-07-13 Thread Stephen C. Gilardi
On Jul 13, 2009, at 11:45 AM, Morgan Allen wrote: The speed difference isn't the main thing- but I *was* under the impression that the only way for java to communicate with clojure was using AOT class compilation. OK, cool. That is another benefit of AOT compilation. The primary use for :ge

Re: Compilation troubles...

2009-07-13 Thread Morgan Allen
> What is your development workflow that requires frequent manual   > recompilation? All Clojure source code is compiled "just in time" as   > it's being loaded and before it's run. What "ahead of time"   > compilation gets you is faster loading times and the ability to deploy   > in a "class file

Re: Clojure vectors

2009-07-13 Thread Chouser
On Mon, Jul 13, 2009 at 11:15 AM, Jan Rychter wrote: > > However, after reading "Programming Clojure" (page 114) I expected to be > able to use sequence functions, such as drop-last, without my vectors > changing representation. It seems this is not the case, as after calling > drop-last (or indee

Re: Clojure vectors

2009-07-13 Thread Mark Engelberg
On Mon, Jul 13, 2009 at 8:15 AM, Jan Rychter wrote: > And while we're on the subject -- any hints for implementing a stack > with a fast item count? (apart from a list with a separate counter) Using conj and pop on vectors for stack operations should work just fine. Don't use subvec though; nest

Re: Clojure vectors

2009-07-13 Thread Kevin Downey
the sequence functions operate on sequences. if you pass in something that is not a sequence, like a vector, they call seq on it internally. so what you get back from filter or map is a sequence. conj has consistent behavior across types, you just get a different type out of map/filter/etc then wh

Clojure vectors

2009-07-13 Thread Jan Rychter
I've been trying to implement stacks using vectors in Clojure. In case you wonder why, it's because I need stacks with a fast item count operation. While experimenting I discovered some vector properties which were unexpected. conj adds at the end of the vector as expected: user> (conj [1 2 3] 4

Re: Bug? (keyword ...)

2009-07-13 Thread Rich Hickey
On Jul 13, 10:42 am, "Stephen C. Gilardi" wrote: > On Jul 13, 2009, at 9:56 AM, jon wrote: > > > It would seem cleaner if the java Keyword.intern() and Symbol.intern() > > methods were symmetrical and used the same way in core.clj. > > It looks unintended to me. Rich, I can provide a patch if a

Re: Bug? (keyword ...)

2009-07-13 Thread Stephen C. Gilardi
On Jul 13, 2009, at 9:56 AM, jon wrote: It would seem cleaner if the java Keyword.intern() and Symbol.intern() methods were symmetrical and used the same way in core.clj. It looks unintended to me. Rich, I can provide a patch if a ticket and patch are welcome. --Steve smime.p7s Descrip

Re: Compilation troubles...

2009-07-13 Thread Stephen C. Gilardi
On Jul 12, 2009, at 4:41 PM, Morgan Allen wrote: Fair enough. However, what I had in mind was that I could simply compile one namespace that would then act as a sort of 'bootstrap loader' for other clojure source, so that I wouldn't have to recompile manually all the time. Rayne's suggestion

Bug? (keyword ...)

2009-07-13 Thread jon
Hi Rich, is this intended behavior? (v1.0 and trunk) --- for literal symbols, seems sensible -- 'a/b => a/b (namespace 'a/b) => "a" (name 'a/b) => "b" --- for generated symbols, seems sensible -- (symbol "a/b") => a/

Re: Using Ref

2009-07-13 Thread Jarkko Oranen
On Jul 13, 1:39 pm, "sailormoo...@gmail.com" wrote: > Hi : > >   I would like to simulate a simple database with the STM of clojure. > The rules are > 1. There can be many rooms, and each room has its own attirbute > 2. One room contains many people, and each person has its own > attribute > 3. r

classloaders, modularity, packaging

2009-07-13 Thread Stuart Sierra
Hi folks, I agreed to talk about Clojure at Philly Lambda on July 21st. I'm working on a presentation about modularity -- packaging, library management, ClassLoaders, that sort of thing. I want to cover some of the popular library managers out there (Rubygems, CPAN) and what it's like on the Jav

Re: AnotherClojureBox new version!

2009-07-13 Thread Darmac
Yes, you are right! WinCommand is the repl! I think that the problem that you have is with java location. Did you set JAVA_HOME in wincommand.ini? this variable will replace JAVA_HOME in the path of clojure application config (last two lines of the [applications] area). If you have java home def

Re: Java STM

2009-07-13 Thread Daniel
On Mon, Jul 13, 2009 at 1:36 PM, Daniel wrote: > On Mon, Jul 13, 2009 at 7:55 AM, Mark Volkmann > wrote: >> >> On Sun, Jul 12, 2009 at 7:07 PM, Vagif Verdi wrote: >>> >>> Potentially interesting library for clojurians. Java STM >>> implementation: http://www.deucestm.org/ >> >> As best I can tell

Re: Java STM

2009-07-13 Thread Daniel
On Mon, Jul 13, 2009 at 7:55 AM, Mark Volkmann wrote: > > On Sun, Jul 12, 2009 at 7:07 PM, Vagif Verdi wrote: >> >> Potentially interesting library for clojurians. Java STM >> implementation: http://www.deucestm.org/ > > As best I can tell, this is yet another "on your honor" STM > implementation.

Using Ref

2009-07-13 Thread sailormoo...@gmail.com
Hi : I would like to simulate a simple database with the STM of clojure. The rules are 1. There can be many rooms, and each room has its own attirbute 2. One room contains many people, and each person has its own attribute 3. rooms can be created, and deleted, and people can be added into or re

Re: Compilation troubles...

2009-07-13 Thread Rayne
I suggest writing a short ant build file to automate building your project, that way you don't have to type all that stuff! I wrote a little build.xml file for a project I'm working on. You should be able to extend it to fit your project. I also suggest looking at Clojure and Clojure-contrib's own

Re: Why do Enlive template functions return a seq instead of a str?

2009-07-13 Thread Robert Campbell
Thanks guys, that makes perfect sense to me. I have another Enlive question: I need the _exact_ functionality of the "sniptest" function (which appears to have been removed) in production code. I am trying to create a decorator in compojure that will accept a response body and modify the styling

Re: Java STM

2009-07-13 Thread Christian Vest Hansen
I believe that DeuceSTM i primarily intended as a research platform for Java STMs, hence the flexibility with pluggable algorithms. Another Java STM is multiverse: http://code.google.com/p/multiverse/ - the focus here is on performance. Multiverse is based on MVCC, like the Clojure STM. Both of