Re: Swank broken at r1369

2009-05-25 Thread Baishampayan Ghose
graham wrote: > I had this problem too and solved it by adding the swank path to my > classpath as Paul suggested. Now on r1373 it seems to be working > again as before, so you could try updating to the latest svn. I still get the same error with the latest SVN. But using technomancy's swank-cloj

Re: Architecture for a clojure project

2009-05-25 Thread Daniel Lyons
On May 25, 2009, at 7:17 PM, Andrew Wagner wrote: > Seems straightforward enough. My difficulty though comes in trying > to figure out how to write the winboard bit. I know how to do the IO > stuff, that's pretty trivial. But, let's say I'm ready to ask the > engine what move to make in a p

Re: Feedback on new persistentmatrix datatype

2009-05-25 Thread Konrad Hinsen
On 26.05.2009, at 00:31, aperotte wrote: > I don't expect to yield the same results. I would expect (.index m > (int-array [0 1])) and (-> m (nth 1) (nth 0)) to yield the same > results. This is because the first is equivalent to taking item 0 in > the first dimension (always rows) and item 1 i

Re: Architecture for a clojure project

2009-05-25 Thread Konrad Hinsen
On 26.05.2009, at 03:17, Andrew Wagner wrote: > Seems straightforward enough. My difficulty though comes in trying > to figure out how to write the winboard bit. I know how to do the > IO stuff, that's pretty trivial. But, let's say I'm ready to ask > the engine what move to make in a parti

using clojure.parallel functions / JSR-166

2009-05-25 Thread Mark Volkmann
I understand that at least some of the functions in the clojure.parallel namespace depend on addtional JAR files related to JSR-166. I found the site http://gee.cs.oswego.edu/dl/concurrency-interest/ which has links to JAR files for that. When I run (use 'clojure.parallel) from a REPL I get: java

Re: CLJDB: Using Emacs/JDB mode with Clojure

2009-05-25 Thread George Jahad
On May 25, 5:53 pm, David Nolen wrote: > Oops actually it works for .clj files that have been loaded via :use and > :require in the ns declaration, but not for the source file you're editing > (it seems). Have you found a workaround for this or have a usage pattern > where you can get it to wor

Architecture for a clojure project

2009-05-25 Thread Andrew Wagner
I'm trying to wrap my head around how to architect this project. I've got some functional programming experience (with Haskell), but am pretty new to Lisps, and feel a bit lost without the type system. So. The project is a chess AI. Now the nice thing is, there's a protocol for interacting with a

Re: CLJDB: Using Emacs/JDB mode with Clojure

2009-05-25 Thread David Nolen
Oops actually it works for .clj files that have been loaded via :use and :require in the ns declaration, but not for the source file you're editing (it seems). Have you found a workaround for this or have a usage pattern where you can get it to work for the current file being edited? On Mon, May 2

Re: CLJDB: Using Emacs/JDB mode with Clojure

2009-05-25 Thread George Jahad
On May 25, 4:51 pm, David Nolen wrote: > Just got around to messing with this today, this is great. > I note that cljdb can't point to the exact location inside of Clojure source > files (it works in Java files). It knows where you are, but you don't get > line highlighting or the line pointer

Re: CLJDB: Using Emacs/JDB mode with Clojure

2009-05-25 Thread David Nolen
Just got around to messing with this today, this is great. I note that cljdb can't point to the exact location inside of Clojure source files (it works in Java files). It knows where you are, but you don't get line highlighting or the line pointer in .clj files. Is this difficult to implement? Th

Re: Feedback on new persistentmatrix datatype

2009-05-25 Thread aperotte
Oh ok, I think I see where the problem is. There's a mistake/bug in how I rerepresent the nested array. I represent that array as a 2x3 internally, when it should actually be a 3x2. Which is why I was thinking the printing was (and still is) backwards. However, these two statements: >

Re: Feedback on new persistentmatrix datatype

2009-05-25 Thread aperotte
Oh ok, I think I see where the problem is. There's a mistake/bug in how I rerepresent the nested array. I represent that array as a 2x3 internally, when it should actually be a 3x2. Which is why I was thinking the printing was (and still is) backwards. However, these two statements: >

Re: Feedback on new persistentmatrix datatype

2009-05-25 Thread Konrad Hinsen
On 25.05.2009, at 21:08, aperotte wrote: > Say that you're dealing with a structure of x dimensions. In this > frame, imagine that you have a list of x-1 dimensional objects in a > list that is as long as the xth dimension. You can cons up these > things that are n-1 in dimensionality and use n

Re: Swank broken at r1369

2009-05-25 Thread Phil Hagelberg
Paul Mooser writes: > I believe you're running into the fact that add-classpath doesn't work > in the same way that it used to since r1369. Basically, the swank > paths are failing to be added to your classpath at runtime - you can > get around this either by reverting to an older version of c

Re: Feedback on new persistentmatrix datatype

2009-05-25 Thread aperotte
Hi Konrad, In writing these functions, I was trying to blend the worlds of lispy data structure building and more familiar matrix indexing. I wanted to be able to treat matrices like elements of a list that could be consed/conjed together to build up data abstractions. This is necessary to keep

Re: question about deftype usage

2009-05-25 Thread Feng
On May 25, 6:47 am, Konrad Hinsen wrote: > On 24.05.2009, at 07:01, Feng wrote: > > > clojure.contrib.types/deftype assumes data to tag are created fresh > > with no meta data. Would it be useful to have it update meta data if > > data are already initialized with meta data, e.g. from file or d

Re: Swank broken at r1369

2009-05-25 Thread graham
I had this problem too and solved it by adding the swank path to my classpath as Paul suggested. Now on r1373 it seems to be working again as before, so you could try updating to the latest svn. --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Feedback on new persistentmatrix datatype

2009-05-25 Thread Konrad Hinsen
On May 19, 2009, at 14:28, aperotte wrote: > Let me know if you have any questions or comments! Indexing: (def data [[1 2] [3 4] [5 6]]) (def m (PersistentMatrix/create (int-array [1]) true)) -> # (.index m (int-array [0 1])) -> 3 (-> m (nth 0) (nth 1)) -> 2 I'd expect the last two expressi

Re: Swank broken at r1369

2009-05-25 Thread Paul Mooser
I believe you're running into the fact that add-classpath doesn't work in the same way that it used to since r1369. Basically, the swank paths are failing to be added to your classpath at runtime - you can get around this either by reverting to an older version of clojure, OR you can pass an expl

Re: RDF in Clojure - best practise?

2009-05-25 Thread e
i see it is already being worked: http://wiki.neo4j.org/content/Clojure On Mon, May 25, 2009 at 8:57 AM, e wrote: > neo4j could be good for this: > http://neo4j.org/ ..or google it > > > On Sun, May 24, 2009 at 7:37 PM, Richard Newman wrote: > >> >> Generally, the sequence approach would be

Re: RDF in Clojure - best practise?

2009-05-25 Thread e
neo4j could be good for this: http://neo4j.org/ ..or google it On Sun, May 24, 2009 at 7:37 PM, Richard Newman wrote: > > Generally, the sequence approach would be slow: you need indices to > make querying RDF reasonable. > > I'd love to see a Clojure-native RDF library that used laziness a

Re: svn r1370 appears to have broken binding

2009-05-25 Thread Rich Hickey
On Mon, May 25, 2009 at 5:35 AM, Stephen C. Gilardi wrote: > With svn r1370, I get this: > >% java -cp clojure.jar clojure.main >Clojure 1.1.0-alpha-SNAPSHOT >user=> (def a) >#'user/a >user=> (binding [a 4] a) >java.lang.IllegalStateException: Var u

value of *file* in the REPL - guaranteed?

2009-05-25 Thread Korny Sietsma
Hi - I noticed that while http://clojure.org/api#toc16 indicates: *file* The path of the file being evaluated, as a String. Evaluates to nil when there is no file, eg. in the REPL. It actually seems to evaluate to "NO_SOURCE_FILE". I'm trying to write a quick and dirty logger that logs to

Re: svn r1370 appears to have broken binding

2009-05-25 Thread Frantisek Sodomka
Hello Steve! When I write a test for binding for this case (using deftest) and run test_clojure, it doesn't error out. I wonder why is that? (def a) (deftest test-binding (are (= _1 _2) (binding [a 4] a) 4 ; regression in Clojure SVN r1370 )) Frantisek PS: Rich, have you seen my

Swank broken at r1369

2009-05-25 Thread Baishampayan Ghose
Hello, I updated clojure and found that Swank somehow broke at r1369. I am getting the following error when I try loading SLIME inside Emacs. user=> user=> java.io.FileNotFoundException: Could not locate swank/swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:0) user=> user=> j

Re: question about deftype usage

2009-05-25 Thread Konrad Hinsen
On 24.05.2009, at 07:01, Feng wrote: > clojure.contrib.types/deftype assumes data to tag are created fresh > with no meta data. Would it be useful to have it update meta data if > data are already initialized with meta data, e.g. from file or db with > other meta data, but :type ::constructor are

svn r1370 appears to have broken binding

2009-05-25 Thread Stephen C. Gilardi
With svn r1370, I get this: % java -cp clojure.jar clojure.main Clojure 1.1.0-alpha-SNAPSHOT user=> (def a) #'user/a user=> (binding [a 4] a) java.lang.IllegalStateException: Var user/a is unbound. (NO_SOURCE_FILE:0) user=> With svn r1369, I ge

Re: Question about building modular code in Clojure

2009-05-25 Thread Konrad Hinsen
On 23.05.2009, at 02:13, Mark Engelberg wrote: > OK, after looking at deftemplate with macroexpand, it's starting to > make more sense. I suppose one downside to this versus load is that > it's probably much more difficult to debug (just because all your code > is wrapped in a macro), but basica