Re: Data structure design question

2009-10-09 Thread Timothy Pratley
On Oct 9, 1:21 pm, Robert Luo robort...@gmail.com wrote: Hi, I am working on a server project, which requires thousands records Just FYI this came up a while ago: http://groups.google.com/group/clojure/browse_thread/thread/8c09cab025a716f4 I'm very interested in this also - if it has been

forward decls / autodef?

2009-10-09 Thread Raoul Duke
hi, are there any plans to something along the lines of e.g. having autodef be something that can be turned on per-file via some expression in the file itself? thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: ANN: scriptjure, a library for generating javascript

2009-10-09 Thread Meikel Brandmeyer
Hi, On Oct 9, 5:38 am, Allen Rohner aroh...@gmail.com wrote: That is a good point. I'm actually not sure why I used type there. It's probably a bug. Thanks for pointing it out. I would leave type here. Then the user can override the emit-function if he has self-defined types which need

Re: ANN: scriptjure, a library for generating javascript

2009-10-09 Thread Meikel Brandmeyer
Hi, On Oct 9, 5:37 am, Allen Rohner aroh...@gmail.com wrote: It was a minor thing actually, I didn't like having to quote user code, and AFAIK, it's not possible to add a quasiquote as part of a macro. i.e. in my code, there is a function (_js) that does the heavy lifting, and the macro

Re: forward decls / autodef?

2009-10-09 Thread Meikel Brandmeyer
Hi, On Oct 9, 8:49 am, Raoul Duke rao...@gmail.com wrote: are there any plans to something along the lines of e.g. having autodef be something that can be turned on per-file via some expression in the file itself? The Right Way (ie. the one Rich chose for Clojure) is to use declare to do

Re: What does this error mean?

2009-10-09 Thread Lauri Pesonen
2009/10/8 John Harrop jharrop...@gmail.com: java.lang.ClassFormatError: Unknown constant tag 52 in class file queries__init (Trial.clj:0) Almost certainly, it occurs in some part of the code that works on a class's bytecodes either directly on disk or in the form of an unstructured Java

Java translation problem

2009-10-09 Thread tommy c
I'm trying to translate a java lucene indexer to clojure. This java line is bothersome: writer = new IndexWriter(dir, new SimpleAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED); I'm doing: (import '(org.apache.lucene.index IndexWriter)) (def index-writer (new IndexWriter dir (new

Re: Java translation problem

2009-10-09 Thread Laurent PETIT
Oh, I guess you also have to import IndexWriter$MaxFieldLength (not sure though, test with both !) : (import '(org.apache.lucene.index IndexWriter IndexWriter$MaxFieldLength)) 2009/10/9 Laurent PETIT laurent.pe...@gmail.com Hi, quick answer : try (IndexWriter$MaxFieldLength/UNLIMITED)

Re: Java translation problem

2009-10-09 Thread Lauri Pesonen
2009/10/9 tommy c wheels...@gmail.com: I'm trying to translate a java lucene indexer to clojure. This java line is bothersome:  writer = new IndexWriter(dir, new SimpleAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED); MaxFieldLength is an inner class in IndexWriter and UNLIMITED is

Performance tuning for a simple SLE solver

2009-10-09 Thread andi.xeno...@googlemail.com
Hi, I'm new to Clojure, and let me first say that I love it! At least I love the language, but I have some concerns regarding performance: My first try was to implement a Gauß elemination algorithm for solving a system of linear equations. Here is the code:

Re: The Enclojure REPL System (It's not just for Netbeans!)

2009-10-09 Thread Eric Thorsen
Laurent, In the code analysis section of the article: http://www.enclojure.org/The+Enclojure+REPLs+%28Not+just+for+Netbeans%21%29#ExampleCodeAnalysis It points you to where the bulk of the communications layer is. I would be interested in what features of the UI pieces you feel are overlapping

Re: Data structure design question

2009-10-09 Thread Stuart Sierra
Honestly, this sounds like a problem for a full-fledged database. With Clojure/datalog, you'll need to persist your records to disk manually. At some point, your thousands of references will start to look like a mini-database anyway. If you can fit your data into a relational schema, use that;

tuplespace and clojure?

2009-10-09 Thread Wilson MacGyver
Someone wrote an in-memory tuplespace implmentation in groovy here http://code.google.com/p/gruple/ I look through it and was trying to compare it against clojure's various structures for concurrency. But I'm having a hard time either finding the equivalent, or what tuplespace would bring to the

Re: Data structure design question

2009-10-09 Thread Wilson MacGyver
I suspect people are looking for the clojure's equivalent of erlang's mnesia. Which at the moment doesn't exist as far as I know. On Fri, Oct 9, 2009 at 11:15 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: Honestly, this sounds like a problem for a full-fledged database. With

Why the solution is slow in execution?

2009-10-09 Thread vishy
Hi, I was attempting problem no 4 at projecteuler.net. The solution I came up with was http://paste.lisp.org/display/88432 But, it executes very slowly.Why so? regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

clj-xpath

2009-10-09 Thread Kyle R. Burton
Hello all, We needed to use xpath at work, and though zip-filter is nice, it isn't actually xpath and that's what we wanted in this case - so we wrote a little wrapper library to make using xpath from Clojure simpler. I've put the library up on github here:

Re: Why the solution is slow in execution?

2009-10-09 Thread Christophe Grand
Hi, On Fri, Oct 9, 2009 at 7:22 PM, vishy vishalsod...@gmail.com wrote: I was attempting problem no 4 at projecteuler.net. The solution I came up with was http://paste.lisp.org/display/88432 But, it executes very slowly.Why so? Your code: (use 'clojure.contrib.combinatorics) (apply max

Suggestions for macro

2009-10-09 Thread nilamo
Hey all. I'm pretty new to Clojure, and wanted to try my hand at writing a macro. 'dowhile' is nothing special, but I'd still like to hear any comments/ suggestions you may have. (defmacro dowhile [body test] `(do ~body (while ~test ~body))) A test shows... (macroexpand-1 '(dowhile (dosync

Re: Suggestions for macro

2009-10-09 Thread Howard Lewis Ship
I'd tend to code this so that the test was the first form, and then any number of additional remaining forms become the body, in an implicit do. Obviously, if you're writing something like this, its for side effects. In addition, I'd wrap the body in an annonymous function, defined in a let, so

Re: The Enclojure REPL System (It's not just for Netbeans!)

2009-10-09 Thread Laurent PETIT
Hi Eric, 2009/10/9 Eric Thorsen ethor...@enclojure.org Laurent, In the code analysis section of the article: http://www.enclojure.org/The+Enclojure+REPLs+%28Not+just+for+Netbeans%21%29#ExampleCodeAnalysis It points you to where the bulk of the communications layer is. Thanks. I started

Re: Data structure design question

2009-10-09 Thread Anders Nawroth
If you look into using a database, the graph database Neo4j could be of interest as well. Some people use it in Clojure and have written different wrappers for it, see: http://wiki.neo4j.org/content/Clojure I'm not sure regarding handling this amount of simultaneous threads, but Neo4j is

Help with closures

2009-10-09 Thread Mark Tomko
Okay, I'm flummoxed. Given the following definition: (defn make-n-gram-fn [n] (fn [coll] (map vec (partition n 1 coll I can do this: (def bi-gram (make-n-gram-fn 2)) (bi-gram abc) ([\a \b] [\b \c]) But, if I add the following: ; counts the number of indexes in a pair of collections

On using GPL libs in Clojure

2009-10-09 Thread Elliott Slaughter
Hi, I am trying to figure out whether I can use GPL'd libraries in my Clojure project or not. Am I allowed to distribute unmodified copies of clojure.jar in my MIT (or other liberally licensed) project? Am I allowed to distribute and use unmodified copies of GPL'd libs as jars? I've been told

Re: Help with closures

2009-10-09 Thread Shawn Hoover
On Fri, Oct 9, 2009 at 10:37 PM, Mark Tomko mjt0...@gmail.com wrote: ; a returns a new similarity function that applies the provided transform function ; before comparing a pair of collections (defn make-coll-similarity-fn [coll-transform] (fn [coll1 coll2] coll-similarity [coll1 coll2

Re: Help with closures

2009-10-09 Thread Mark Tomko
Of course. I'm not sure what I was thinking. Thank you. On Oct 9, 7:47 pm, Shawn Hoover shawn.hoo...@gmail.com wrote: On Fri, Oct 9, 2009 at 10:37 PM, Mark Tomko mjt0...@gmail.com wrote: ; a returns a new similarity function that applies the provided transform function ; before

Re: Suggestions for macro

2009-10-09 Thread nilamo
That does look better. I had trouble with the anonymous func, however. After working it out, here's what I think the problem is, as well as what I did about it. ~...@body expands the body (which is a list) so that the elements of the list are represented without the surrounding parens.

noob having a tough time with emacs setup

2009-10-09 Thread Paul Nakata
I'm trying to get set up in emacs to use clojure. When I try to fire up slime, I get this error: Clojure 1.0.0--SNAPSHOT user= java.io.FileNotFoundException: Could not locate swank/ swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:0) user= user=