Re: Weird Clojure Box - library issue

2009-05-20 Thread hoeck
On 19 Mai, 12:25, martin_clausen martin.clau...@gmail.com wrote: I am trying to use the JACOB library with Clojure using Clojure Box. I have added this to my .emacs: (setq swank-clojure-library-paths (list c:/dev/dlls)) c:/dev/dlls/ contains the jacob-1.14.3-x86.dll I have added a

Re: Question about building modular code in Clojure

2009-05-20 Thread Laurent PETIT
2009/5/18 Mark Engelberg mark.engelb...@gmail.com: On Mon, May 18, 2009 at 4:23 AM, Laurent PETIT laurent.pe...@gmail.com wrote: The most modular I can think of right now is just about creating a gravity type and using multimethods for all your functions. This way you would have dynamic

Re: Weird Clojure Box - library issue

2009-05-20 Thread martin_clausen
Well, at least I am not alone. I think you are right about the emacs/slime thing. Everything just works if I start a REPL from the commandline and add the classpaths/ librarypaths when I invoke it. I have tried this on two separate Windows machines with vastly different configs, so I don't

macro issue

2009-05-20 Thread Per
I want to write a macro that runs a 'defstruct' using a list of names, like below: ;; My tag names (def tags '(name age)) ;; The macro (defmacro def-fields [name tgs] `(defstruct ~name ~@(map #(symbol (str : %)) tgs)) ) ;; Using the macro to define a struct based on 'tags' (def-fields fs

Re: 3d viewer

2009-05-20 Thread John Newman
Including import statements at the top would make it easier for me to try it out. Thanks, On Wed, May 20, 2009 at 4:09 AM, kyle smith the1physic...@gmail.com wrote: I have uploaded 3d-viewer.clj to the files section. If anyone finds it useful, I would appreciate some feedback. -- John

off topic - sending and receiving raw Ethernet frames from clojure/java

2009-05-20 Thread prhlava
Hello, Apologies for off topic post. I would like to send and receive raw ethernet frames from Clojure. So far, I found: http://netresearch.ics.uci.edu/kfujii/jpcap/doc/ but is sending and receiving raw ethernet packets possible with the latest JDK using standard networking stack of JVM?

Re: Weird Clojure Box - library issue

2009-05-20 Thread Shawn Hoover
On Wed, May 20, 2009 at 3:32 AM, hoeck i_am_wea...@kittymail.com wrote: i tried importing those two classes from a recent jacob with slime, xemacs and w2k and exactly the same is happening here. I have a similar problem when starting slime, my emacs blocks and doesn't start the repl until i

Re: Saving the Clojure.org webiste

2009-05-20 Thread Emeka
What about the zip version of save_clojure.org.tar.bz2? Emeka --~--~-~--~~~---~--~~ 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 To unsubscribe from this

Re: macro issue

2009-05-20 Thread pmf
On May 20, 4:47 am, Per nondual...@gmail.com wrote: ;; The macro (defmacro def-fields [name  tgs]   `(defstruct ~name ~@(map #(symbol (str : %)) tgs)) ) If you replace the call to 'symbol' with a call to 'keyword', it works (I think this is what you intended).

Re: macro issue

2009-05-20 Thread Michael Reid
On Wed, May 20, 2009 at 8:44 AM, pmf phil.fr...@gmx.de wrote: On May 20, 4:47 am, Per nondual...@gmail.com wrote: ;; The macro (defmacro def-fields [name tgs] `(defstruct ~name ~@(map #(symbol (str : %)) tgs)) ) If you replace the call to 'symbol' with a call to 'keyword', it works (I

Re: 3d viewer

2009-05-20 Thread kyle smith
Import statements added. Example usage: (def coords [[0 0 0] [1 1 1] [2 2 2]]);etc (g3d coords) That should pop open the viewer. Left click and drag to rotate, and use the scroll wheel to zoom in/out. --~--~-~--~~~---~--~~ You received this message because you

CLJDB: Using Emacs/JDB mode with Clojure

2009-05-20 Thread George Jahad
Hi Kids: I've been working on integrating Emacs JDB, (command line java debug interface,) mode with Clojure. It still a work in progress, and has some funky aspects due to language differences between Clojure and Java, but you can catch exceptions and bring them up in the source code, print

Re: CLJDB: Using Emacs/JDB mode with Clojure

2009-05-20 Thread David Nolen
Wow this sounds fantastic. Wanna put this on GitHub so people can fork it and work on it concurrently? ;) On Wed, May 20, 2009 at 1:51 PM, George Jahad andr...@blackbirdsystems.netwrote: Hi Kids: I've been working on integrating Emacs JDB, (command line java debug interface,) mode with

Wrong type?

2009-05-20 Thread Arie van Wingerden
Hi, when I evaluate: (defn digit? [d] (. Character isDigit d)) (digit? 5) I get false as a result. It appears that the 5 does not match the correct type Java expects, or what? TIA, Arie --~--~-~--~~~---~--~~ You received this message because you are

Re: 3d viewer

2009-05-20 Thread John Newman
Thanks. On my setup I had to add '(javax.swing JFrame) too. Pretty neat. On Wed, May 20, 2009 at 3:12 PM, kyle smith the1physic...@gmail.com wrote: Import statements added. Example usage: (def coords [[0 0 0] [1 1 1] [2 2 2]]);etc (g3d coords) That should pop open the viewer. Left

Re: macro issue

2009-05-20 Thread Chouser
On Wed, May 20, 2009 at 9:59 AM, Michael Reid kid.me...@gmail.com wrote: On Wed, May 20, 2009 at 8:44 AM, pmf phil.fr...@gmx.de wrote: On May 20, 4:47 am, Per nondual...@gmail.com wrote: ;; The macro (defmacro def-fields [name  tgs]   `(defstruct ~name ~@(map #(symbol (str : %)) tgs)) )

Re: macro issue

2009-05-20 Thread Per
Thanks, that makes a lot of sense! Per On May 20, 10:36 am, Chouser chou...@gmail.com wrote: On Wed, May 20, 2009 at 9:59 AM, Michael Reid kid.me...@gmail.com wrote: On Wed, May 20, 2009 at 8:44 AM, pmf phil.fr...@gmx.de wrote: On May 20, 4:47 am, Per nondual...@gmail.com wrote: ;;

Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-20 Thread Ilya Sergey
In last build of La Clojure plugin (thanks to Kurt Christensen) we added REPL integration with history and possibility to load files and evaluate expressions from the editor. With best regards, Ilya Sergey 2009/5/18 Ilya Sergey ilyas...@gmail.com Hello, Asbjørn. For now IntelliJ support of

Re: Question about building modular code in Clojure

2009-05-20 Thread Konrad Hinsen
On 20.05.2009, at 17:14, Konrad Hinsen wrote: Here is another solution that I consider preferable to the use of load. It requires you to specify explicitly which vars you want to be replaceable (which I consider an advantage) That's actually not true: it doesn't require a specification of

Re: Feedback on new persistentmatrix datatype

2009-05-20 Thread Konrad Hinsen
On 19.05.2009, at 14:28, aperotte wrote: Let me know if you have any questions or comments! Two for today: 1) What is the role of the first argument to PersistentMatrix/create? It seems that anything else than (int-array [1]) leads to an error. 2) Shapes and indices are all int, rather

Re: Wrong type?

2009-05-20 Thread Arie van Wingerden
Ah, thanks Laurent! 2009/5/20 Laurent PETIT laurent.pe...@gmail.com Hi, the following session will probably explain the problem: user= (digit? \5) true user= (ancestors java.lang.Integer) #{java.io.Serializable java.lang.Comparable java.lang.Number java.lang.Object} user= (ancestors

Re: Wrong type?

2009-05-20 Thread Laurent PETIT
Hi, the following session will probably explain the problem: user= (digit? \5) true user= (ancestors java.lang.Integer) #{java.io.Serializable java.lang.Comparable java.lang.Number java.lang.Object} user= (ancestors java.lang.Character) #{java.io.Serializable java.lang.Comparable

Re: macro issue

2009-05-20 Thread Per
Thanks, this is going in the right direction. The macro expansion looks correct, but the actual execution still fails: user= (macroexpand '(def-fields fs tags)) (def fs (clojure.core/create-struct :name :age)) user= (def-fields fs tags) java.lang.Exception: Unable to resolve symbol: :name in

Re: CLJDB: Using Emacs/JDB mode with Clojure

2009-05-20 Thread George Jahad
On May 20, 11:20 am, David Nolen dnolen.li...@gmail.com wrote: Wow this sounds fantastic. Wanna put this on GitHub so people can fork it and work on it concurrently? ;) Good idea: http://github.com/GeorgeJahad/cljdb/tree/master --~--~-~--~~~---~--~~ You

Re: CLJDB: Using Emacs/JDB mode with Clojure

2009-05-20 Thread David Nolen
Wow, that was quick thanks. On Wed, May 20, 2009 at 3:26 PM, George Jahad andr...@blackbirdsystems.netwrote: On May 20, 11:20 am, David Nolen dnolen.li...@gmail.com wrote: Wow this sounds fantastic. Wanna put this on GitHub so people can fork it and work on it concurrently? ;) Good

Re: Is apply slow or am I incorrectly benchmarking this?

2009-05-20 Thread Christian Vest Hansen
I'm thinking that integer boxing on the argument to your Fn is perhaps dominating your numbers. I'm not up to date on the compiler, but I'd think that the argument to the direct Math/ceil call is parsed in primitive form. On Wed, May 20, 2009 at 9:38 PM, CuppoJava patrickli_2...@hotmail.com

possible bug?

2009-05-20 Thread Cosmin Stejerean
I have a feeling I'm doing something wrong bug I can't figure it out and I can't rule out that it's not some kind of bug. I am trying to get the public vars exposed by a namespace from a string. I am creating a symbol from the string using Symbol/create and then calling ns-publics. This works just

Re: Is apply slow or am I incorrectly benchmarking this?

2009-05-20 Thread Stephen C. Gilardi
On May 20, 2009, at 3:38 PM, CuppoJava wrote: I'm using apply a lot in my code, and a small micro-benchmark is telling me that it's a very slow operation. Can someone confirm this? I'm wondering whether my benchmark is incorrect, or whether there's a hidden reflection that I'm not seeing.

Re: Is apply slow or am I incorrectly benchmarking this?

2009-05-20 Thread CuppoJava
Thanks a lot for that really detailed analysis Stephen. I do find apply very convenient in a lot of cases, and am using it to save a line or two of code whenever I can. But after seeing this benchmark, I think I shall be more disciplined about my use of it. Especially in the case where the number

laziness performance question

2009-05-20 Thread Raoul Duke
hi, Seems like Haskell's laziness has an aura of it will bite you performance-wise sooner or later. What is different (I'm asking didactically, not snarkily) about Clojure's laziness? Does it manage to avoid some aspects of the uh ohs in Haskell? many thanks.

Re: Is apply slow or am I incorrectly benchmarking this?

2009-05-20 Thread André Ferreira
If efficiency is really an issue (if it's not just use apply), how about using a macro for doing the dirty work of writing the direct function application for you? On 20 maio, 19:44, CuppoJava patrickli_2...@hotmail.com wrote: Thanks a lot for that really detailed analysis Stephen. I do find

Re: possible bug?

2009-05-20 Thread George Jahad
Using cljdb I was able to step through the code and see that the problem is that symbol create is expecting an interned string. Changing this: (def s1 (Symbol/create (first (.split user/n1 / to this: (def s1 (Symbol/create (.intern (first (.split user/n1 /) will fix your problem. g

Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-20 Thread Vagif Verdi
Do you have plans to add connect/disconnect to existing running Repl over the network ? Emacs has this mode with slime and it is very handy in developing web applications. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-20 Thread Antoni Batchelli
Ilya, where can we find documentation about how to use the new features? ... the information on the plugin page is pretty scarce... Good job by the way! Toni. On May 20, 2009, at 12:00 PM, Ilya Sergey wrote: In last build of La Clojure plugin (thanks to Kurt Christensen) we added REPL

Re: Is apply slow or am I incorrectly benchmarking this?

2009-05-20 Thread Mark Fayngersh
thinking of http://w01fe.com/blog/2009/01/pleasant-surprise-clojures-apply-is-lazy/ ? On Wed, May 20, 2009 at 3:38 PM, CuppoJava patrickli_2...@hotmail.comwrote: Hi, I'm using apply a lot in my code, and a small micro-benchmark is telling me that it's a very slow operation. Can someone

Re: laziness performance question

2009-05-20 Thread e
are you saying that Haskell has amortized, not worst-case performance and so fast operations need to be paid for ... like when you have to ripple-carry in binary counting to pay for times when you didn't have to carry the one? On Wed, May 20, 2009 at 7:42 PM, Raoul Duke rao...@gmail.com wrote:

Re: possible bug?

2009-05-20 Thread Cosmin Stejerean
On Wed, May 20, 2009 at 7:04 PM, George Jahad andr...@blackbirdsystems.netwrote: Using cljdb I was able to step through the code and see that the problem is that symbol create is expecting an interned string. Changing this: (def s1 (Symbol/create (first (.split user/n1 / to this: