Problems with http-agent

2009-09-12 Thread Ian Eure
I'm having quite a time getting http-agent from contrib to work. I'm using Clojure 1.0.0 and the clojure-1.0-compat branch of clojure- contrib. 1. I can't get the body of any request: user=> (use 'clojure.contrib.http.agent) nil user=> (let [agent (http-agent "http://google.com";)] (res

Re: questions about datalog

2009-09-12 Thread Josh Smith
On Sep 12, 9:53 pm, Robert Luo wrote: > Thank you Josh for your answer. Thank you for being interested in the datalog library. :) > I have read the sources of datalog, however, literal.clj and the ideas > of the query language behind it is unknown for me, thus I can not > understand it qu

Re: questions about datalog

2009-09-12 Thread Robert Luo
Thank you Josh for your answer. I have read the sources of datalog, however, literal.clj and the ideas of the query language behind it is unknown for me, thus I can not understand it quite well. The same thing happens when I saw magic.clj, in which file I saw "magic transformation". I ran the ex

Re: Pong!

2009-09-12 Thread Sean Devlin
AWESOME On Sep 12, 7:43 pm, jng27 wrote: > http://jng.imagine27.com/articles/2009-09-12-122605_pong_in_clojure.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email t

Pong!

2009-09-12 Thread jng27
http://jng.imagine27.com/articles/2009-09-12-122605_pong_in_clojure.html --~--~-~--~~~---~--~~ 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 Note that posts f

Re: temp variables best practice

2009-09-12 Thread Sean Devlin
I like to use the comp operator to handle these situations ((comp #(Double/parseDouble %) #(javax.swing.JOptionPane/showInputDialog "What is your foobar"))) This is called "point free" style, the name comes from topology. I find it easy to add/remove/reorder operations in this manner. I

Re: clojure-mode survey

2009-09-12 Thread Brenton
I was having the same problem as Jim and ended up just getting SLIME working manually. I wanted to get things set up like Vagif Verdi mentioned above so that I can start the REPL from my own script and then connect to it from emacs using slime-connect. The good news is that I am using SLIME now

Re: temp variables best practice

2009-09-12 Thread Scott Moonen
Terrance, you could do something like this (loose on the syntax): (def final-foo (let [tmpString (. javax.swing.JOptionPane showInputDialog "What is your foobar?")] (. Double parseDouble tmpString))) Look at this comment for one example of a function written both ways: http://lojic.com/blog

Re: temp variables best practice

2009-09-12 Thread Terrance Davis
For instance, in Java ... tmpString = JOptionPane.showInputDialog("What is your foobar?"); finalFoo = Double.parseDouble(tmpString); instead of ... finalFoo = Double.parseDouble(JOptionPane.showInputDialog("What is your foobar?")); I translate this into Clojure as something like ... (def fin

Re: Matlab for Lisp programmers?

2009-09-12 Thread sirpi
It also should be interesting to create a bridge between clojure and Maxima. Transforming clojure expression into maxima expression, for example the Maxima list ((mlist) 1 2 3 4)) is the clojure list '(1 2 3 4) --~--~-~--~~~---~--~~ You received this message

Re: clojure-mode survey

2009-09-12 Thread Jim Menard
On Sat, Sep 12, 2009 at 4:30 PM, Phil Hagelberg wrote: > > Jim Menard writes: > >> A few comments and questions about the setup process: >> >> At the end of the process, the mini-buffer says, "You must specify >> either a `swank-clojure-binary' or a `swank-clojure-classpath'. What >> should thos

Re: temp variables best practice

2009-09-12 Thread Sean Devlin
Could you post an example? It'd be easier to comment on it. On Sep 12, 6:32 pm, Terrance Davis wrote: > Commonly, I break down complex lines of code into several easy to > follow simple lines of code. This results in many temp variables that > are not intended to be used anywhere else in the co

temp variables best practice

2009-09-12 Thread Terrance Davis
Commonly, I break down complex lines of code into several easy to follow simple lines of code. This results in many temp variables that are not intended to be used anywhere else in the code. Sometimes I see a method reusing common primitives and objects (like ints and Strings), so to prevent verbo

Re: Matlab for Lisp programmers?

2009-09-12 Thread Garth Sheldon-Coulson
Patrick and Phil, Consider giving Mathematica another look. I wouldn't repeat David's suggestion if there weren't so many reasons to be enamored of it. Mathematica is to Matlab as Clojure is to Fortran. Mathematica is functional and wonderfully expressive. Matlab is basically the opposite. A compa

Re: clojure-mode survey

2009-09-12 Thread Phil Hagelberg
Jim Menard writes: > A few comments and questions about the setup process: > > At the end of the process, the mini-buffer says, "You must specify > either a `swank-clojure-binary' or a `swank-clojure-classpath'. What > should those values be? I see the swank-clojure directory that has > been ins

Re: Matlab for Lisp programmers?

2009-09-12 Thread Sean Devlin
Ah Matlab... reminds me of school. Culturally, it's the new FORTRAN. I agree, a good Matlab book is hard to find. I'd look into a couple things: 1. Find an engineering book on the problem you're studying. They all include "how to do this in Matlab" nowadays. 2. Google "atlas linear algebra

Re: Matlab for Lisp programmers?

2009-09-12 Thread Stuart Sierra
On Sep 12, 12:17 pm, Max Suica wrote: > You might look at Octave, which is an open source clone of matlab, but > with nothing like simulink :/ . Still, for pretty involved number > crunching and plotting, Octave can do what matlab can, and its > language is similar (it might try to actually be co

Re: Matlab for Lisp programmers?

2009-09-12 Thread peh
I don't see that anyone has answered your question. I too like Matlab and I have also used Mathematica and see the value in both. Matlab though is the superior platform for numerical analysis and computation (in my opinion). I think it offers better features for extensibility and tons of built

Re: questions about datalog

2009-09-12 Thread Josh Smith
On Sep 12, 6:21 am, Robert Luo wrote: > Two more questions: > 3. In datalog.database , it is required that every tuple must has > exactly same field as in database define, is that possible to just > define some necessary fields, and tuples appended can have additional > optional fields? > 4. What

Re: clojure-mode survey

2009-09-12 Thread Phil Hagelberg
Jimmie Houchin writes: > But, I do believe it is of great importance to maintain good > contributors records to the files and its modification history > regardless of code "ownership" but for good legal provenance. Two things: git maintains this record automatically and much more thoroughly

Re: Matlab for Lisp programmers?

2009-09-12 Thread Max Suica
I've been playing with matlab, and I'm liking it... the built in documentation on the language is actually excellent, and the language itself is pretty clean if you're used to java/c/algol type languages. I like especially the built in syntax for matrix and tensor operations, and the fact that ope

Re: clojure-mode survey

2009-09-12 Thread Jim Menard
Phil, > Jim Menard writes: > >> I do something similar to Brenton. I use clojure-mode, and vote for >> keeping it as-is, making SLIME integration optional or ancillary. > > Could you guys give SLIME another shot via M-x clojure-install? If you > haven't been using it because you had a hard time

Re: questions about datalog

2009-09-12 Thread Robert Luo
Two more questions: 3. In datalog.database , it is required that every tuple must has exactly same field as in database define, is that possible to just define some necessary fields, and tuples appended can have additional optional fields? 4. What is a magic transformation? I googled the term, but

Re: How do I access a Java list element?

2009-09-12 Thread carey
Thanks for the help Lauri On 11 Sep, 21:26, Lauri Pesonen wrote: > 2009/9/11 Richard Newman : > > > > >>> Where I'm stuck > >>> is how to get access to the particle names, as I would in the above > >>> line of Java code. > > > The final bit, once you have an iterator over particles, would be: >

questions about datalog

2009-09-12 Thread Robert Luo
I am trying to use datalog now, have the following questions: 1. How about the memory consumption of datalog? 2. There are examples of datalog, but can I find more detailed document about the query language? --~--~-~--~~~---~--~~ You received this message because yo

Re: Tricks for transforming a DB ResultSet into XLM?

2009-09-12 Thread Christophe Grand
Hi Robert, On Fri, Sep 11, 2009 at 4:01 PM, Robert Campbell wrote: > > I am using clojure.contrib.sql which gives me the typical Clojure > ResultSet: a set of maps. Are there any tricks you've used in the past > to transform this into XML? I was looking at Enlive since I've used it > - and loved