Re: noob having a tough time with emacs setup

2009-10-09 Thread Krukow
On Oct 10, 7:10 am, Paul Nakata wrote: > I've tried the ELPA install method and installing with sources from > git and get this error. I'm currently set up with everything in ~/src/ > and I've pulled everything from git using the directions > fromhttp://riddell.us/tutorial/clojure/clojure.htm

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=> java.lang.ClassNotFoundExcep

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. However,

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 wrote: > On Fri, Oct 9, 2009 at 10:37 PM, Mark Tomko wrote: > > ; a returns a new similarity function that applies the provided > > transform function > > ; before comparing a pair of collections > > (defn

Re: Help with closures

2009-10-09 Thread Shawn Hoover
On Fri, Oct 9, 2009 at 10:37 PM, Mark Tomko 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 coll-transform]))

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 t

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

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 designed

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

2009-10-09 Thread Laurent PETIT
Hi Eric, 2009/10/9 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. > Thanks. I started to read the artic

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

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: clj-xpath

2009-10-09 Thread Baishampayan Ghose
Kyle, > 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: > > http://github.com/kyleburton/

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 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 (map (fn [[x y]] (

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: http://github.com/kyleburton/clj-xp

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 Group

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 wrote: > > Honestly, this sounds like a problem for a full-fledged database. > With Clojure/datalog, you'll need to per

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 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; i

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 wit

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

2009-10-09 Thread Laurent PETIT
Eric, thanks for sharing this ! I hope I'll have time to look at it soon. One preliminary question please : I understand there is no dependency on Netbeans, but is there a dependency on a UI fmk at all (you guess why I ask so: Eclipse uses swt, not swing :). Thanks, and keep up the good work !

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

2009-10-09 Thread Thorsen Eric
I've seen talk about socket based REPLs with history etc. and this is something we have been using in Enclojure for over a year now. I put some time into updated the docs, provided samples for running REPLs outside of Netbeans and put together a fairly detailed article about the REPL archi

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: http://www.xenoage.com/extern/zongblo

Re: Java translation problem

2009-10-09 Thread Lauri Pesonen
2009/10/9 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); MaxFieldLength is an inner class in IndexWriter and UNLIMITED is a static field

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 > Hi, quick answer : > > try (IndexWriter$MaxFieldLength/UNLIMITED) > > > > HTH > > -- > Lauren

Re: Java translation problem

2009-10-09 Thread Laurent PETIT
Hi, quick answer : try (IndexWriter$MaxFieldLength/UNLIMITED) HTH -- Laurent 2009/10/9 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);

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 SimpleAn

Re: What does this error mean?

2009-10-09 Thread Lauri Pesonen
2009/10/8 John Harrop : >> 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 > byte array; hope

Re: forward decls / autodef?

2009-10-09 Thread Meikel Brandmeyer
Hi, On Oct 9, 8:49 am, Raoul Duke 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 forward declarat

Re: ANN: scriptjure, a library for generating javascript

2009-10-09 Thread Meikel Brandmeyer
Hi, On Oct 9, 5:37 am, Allen Rohner 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 (js). I couldn'

Re: ANN: scriptjure, a library for generating javascript

2009-10-09 Thread Meikel Brandmeyer
Hi, On Oct 9, 5:38 am, Allen Rohner 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 special handling for