Re: leiningen powershell script

2010-02-15 Thread Rob Wolfe
On 15 Lut, 07:42, Brian Wolf brw...@gmail.com wrote: Hi, I am trying to run    (http://bit.ly/82zo95http://bit.ly/82zo95 )   powershell script for leiningen install under windows, but it says it can't find file, which file it doesn't say. I was wondering  what dependencies leiningen  has?

Re: deftype comment

2010-02-15 Thread Konrad Hinsen
On 14.02.2010, at 22:48, Mark Engelberg wrote: Actually, the more I think about it, the more I feel like deftype's specify clojure.lang.IPersistentMap as an interface with no implementation, and you'll get a default implementation seems like a weird exception, I agree. The current deftype is

Re: how to use with-bindings*

2010-02-15 Thread Аркадий Рост
thanks) -- 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 from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email

Re: how to use with-bindings*

2010-02-15 Thread Аркадий Рост
oh wait...I take a look on binding and with-binding* realesation. http://github.com/richhickey/clojure/blob/f4c58e3500b3668a0941ca21f9aa4f444de2c652/src/clj/clojure/core.clj#L1251 Why with-binding* function wasn't write like this: (defn with-bindings* [bindings f args] (assert-args binding

Re: how to use with-bindings*

2010-02-15 Thread Jarkko Oranen
On Feb 15, 12:03 pm, Аркадий Рост arkr...@gmail.com wrote: oh wait...I take a look on binding and with-binding* realesation.http://github.com/richhickey/clojure/blob/f4c58e3500b3668a0941ca21f9a... Why with-binding* function wasn't write like this: (defn with-bindings*   [bindings f args]  

Toying around with REPL: java.lang.IndexOutOfBoundsException

2010-02-15 Thread Matthias von Rohr
Hi everyone, I'm fairly new to clojure but having a great time right now with this beautiful language. I've been toying around with the REPL this morning: http://paste.lisp.org/display/94972 Now the question arises, am I missing the point or is this some sort of an internal restriction? Any

Compilation and Class Generation newbie questions

2010-02-15 Thread Paulo Sérgio Medeiros
Hello everyone, I think i've not figured out yet how compile and/or namespace works. I'm trying to execute the example posted in http://clojure.org/compilation I've created a file named hello.clj and put the clojure.jar in the same directory (c:\clojure_tests). Then, i started the REPL using

Re: how to use with-bindings*

2010-02-15 Thread Jonas Enlund
On Mon, Feb 15, 2010 at 7:25 AM, Аркадий Рост arkr...@gmail.com wrote: Hi! I was playing a bit with with-bindings* function, but I got error every time. I've tried: (def a 5) (with-bindings* {a 3} println a) ;; got java.lang.Integer cannot be cast to clojure.lang.Var (with-bindings*

Re: Compilation and Class Generation newbie questions

2010-02-15 Thread Alex Ott
Hello If you declared clojure.examples.hello namespace, then you need to have file hello.clj in clojure/examples/ directory. and you need to have c:\clojure_tests in classpath, something like: java -cp clojure.jar:c:\clojure_tests clojure.main Paulo Sérgio Medeiros at Mon, 15 Feb 2010 03:13:51

Re: Compilation and Class Generation newbie questions

2010-02-15 Thread Meikel Brandmeyer
Hi, On Feb 15, 6:13 am, Paulo Sérgio Medeiros pase...@gmail.com wrote: I think i've not figured out yet how compile and/or namespace works. I'm trying to execute the example posted inhttp://clojure.org/compilation I've created a file named hello.clj and put the clojure.jar in the same

Re: Toying around with REPL: java.lang.IndexOutOfBoundsException

2010-02-15 Thread Meikel Brandmeyer
Hi, On Feb 15, 9:10 am, Matthias von Rohr matthias.vonr...@gmail.com wrote: I'm fairly new to clojure but having a great time right now with this beautiful language. I've been toying around with the REPL this morning: http://paste.lisp.org/display/94972 Now the question arises, am I

Re: Toying around with REPL: java.lang.IndexOutOfBoundsException

2010-02-15 Thread Michał Marczyk
nth is internally defined as the nth static method of the class clojure.lang.RT. That method takes an argument of type int as the index, whereas the huge index you supplied doesn't fit in an int and is normally a BigInteger. I guess that when you pass that to a Java method which expects an int, it

Re: processing two collections

2010-02-15 Thread Glen Rubin
Thank you so much This is really wonderful advice...saved me months of learning. I have rewritten my code as follows: ;definition of a palindrome (defn palindrome? [s] (= s (apply str (reverse s ;list of palindromes for range of numbers (defn palindromes [start end]

Re: processing two collections

2010-02-15 Thread Steve Purcell
On 15 Feb 2010, at 13:50, Glen Rubin wrote: Thank you so much This is really wonderful advice...saved me months of learning. I have rewritten my code as follows: You'll want to use let in place of all of those def declarations. -Steve -- You received this message because you are

PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the subseq wrapper for seqFrom. For instance, let's say your keys are dollar values you could do (subseq my-map 30) to get all entries with keys greater than 30 or (subseq my-map

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
with keys that range between 30 and 11 should read with keys that range between 30 and 100 On Mon, Feb 15, 2010 at 10:45 PM, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the subseq

Re: processing two collections

2010-02-15 Thread Meikel Brandmeyer
Hi, On Feb 15, 2:50 pm, Glen Rubin rubing...@gmail.com wrote:   ;definition of a palindrome   (defn palindrome? [s]     (= s (apply str (reverse s You might want to call vec on the string and then rseq instead of reverse. reverse walks the string twice, while rseq just walks the string

Re: processing two collections

2010-02-15 Thread Steve Purcell
On 15 Feb 2010, at 13:58, Steve Purcell wrote: On 15 Feb 2010, at 13:50, Glen Rubin wrote: Thank you so much This is really wonderful advice...saved me months of learning. I have rewritten my code as follows: You'll want to use let in place of all of those def declarations.

Re: Toying around with REPL: java.lang.IndexOutOfBoundsException

2010-02-15 Thread Matthias von Rohr
Yep, you're right, I just debugged it and its an int overflow (nth gets called with a parameter int n=-279969792) Matt -- 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 from

Re: contrib.sql with postgresql is really a problem

2010-02-15 Thread Andreas Schipplock
Hi Richard, thanks for clarification. However, http://www.google.com/search?q=clojure.contrib.sql+timestamp+postgresql now returns at least one relevant result (position #1) :). I created the promised blog post and google seems to be quick. Thanks, Andreas Schipplock. On Sun, Feb 14, 2010 at

Re: deftype comment

2010-02-15 Thread Rich Hickey
On Mon, Feb 15, 2010 at 3:56 AM, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 14.02.2010, at 22:48, Mark Engelberg wrote: Actually, the more I think about it, the more I feel like deftype's specify clojure.lang.IPersistentMap as an interface with no implementation, and you'll get a

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread Sean Devlin
If you are running Java 6 you could always use java.util.NavigatibleMap/Set. However, this is a workaround, and it would be great to see Clojure support these log(N) operations directly. On Feb 15, 8:45 am, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
Hey, Sean -- that's the alternative that I've been using for performance reasons. Unfortunately, I can't put it in a ref (well, I suppose I could but the behavior is unspecified and definitely not good). It'd be useful to have both the concurrency benefits of the immutable/persistent

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread Rich Hickey
On Mon, Feb 15, 2010 at 8:45 AM, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the subseq wrapper for seqFrom. For instance, let's say your  keys are dollar values you could do (subseq

Re: PersistentTreeMap, seqFrom, subseq and range queries

2010-02-15 Thread George .
Sorry, I was mistaken. On Tue, Feb 16, 2010 at 12:23 AM, Rich Hickey richhic...@gmail.com wrote: On Mon, Feb 15, 2010 at 8:45 AM, George . clojuri...@gmail.com wrote: Currently, if you want to perform a range query on a sorted-seq (AKA PersistentTreeMap), you are are advised to use the

Re: how to use with-bindings*

2010-02-15 Thread Аркадий Рост
Yeah.. That function is very confused. I didn't check it, sorry. I don't understand the reason to make the argument binding-map: for example, using binding macro: (binding [a 5] ...do something...) ;;using vector to contain bindings. but using with-bindings*: (with-bindings* {#'a 5} f args)

When to use loop recur / seq functions?

2010-02-15 Thread stefanmuenchow
Hello, I'm new to clojure and have a question concerning recur and lazy seqs. I implemented a function to calculate the perimeter of a polygon. As I'm used to Java and imperative programming, my first approach was to use loop/recur ('euclidean-distance' is a helper-function that calculates the

Re: Compilation and Class Generation newbie questions

2010-02-15 Thread Paulo Sérgio Medeiros
Hi! Thanks, i think i haven't executed java from command line for a while and forgot some things. ;-) On Mon, Feb 15, 2010 at 11:32 AM, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Feb 15, 6:13 am, Paulo Sérgio Medeiros pase...@gmail.com wrote: I think i've not figured out yet how compile

newbie question: Please help me stop creating constructors

2010-02-15 Thread Yaron
I am writing a calculator to figure out if I should sell or rent my home using Clojure. This is my first Clojure program so I'm about as wet behind the ears as it gets. So far everything is actually going really well (reminds me of the fun I had with Scheme in college) but for one thing. My

Re: leiningen powershell script

2010-02-15 Thread Brian Wolf
Rob Wolfe wrote: On 15 Lut, 07:42, Brian Wolf brw...@gmail.com wrote: Hi, I am trying to run(http://bit.ly/82zo95http://bit.ly/82zo95 ) powershell script for leiningen install under windows, but it says it can't find file, which file it doesn't say. I was wondering what dependencies

Re: clojure-dev: #55: clojure.contrib.sql expects *err* to be a PrintWriter Ticket updated - Resolution?

2010-02-15 Thread Stuart Halloway
I had proposed that c.c.sql use c.c.logging, and Steve was ok with that, but I held off after all the back and forth about logging itself. I would be just as happy to see no logging no wrapping/throwing at this level. If you make a patch that does this (and nag me a little :-) ) I will

Re: leiningen powershell script

2010-02-15 Thread Rob Wolfe
On 15 Lut, 20:50, Brian Wolf brw...@gmail.com wrote: Rob Wolfe wrote: On 15 Lut, 07:42, Brian Wolf brw...@gmail.com wrote: Hi, I am trying to run    (http://bit.ly/82zo95http://bit.ly/82zo95 )   powershell script for leiningen install under windows, but it says it can't find file,

Re: What is a form, exactly? + Are there any guarantees about the return types of quote and syntax-quote?

2010-02-15 Thread Meikel Brandmeyer
Hi, On Sun, Feb 14, 2010 at 08:58:56PM -0500, Garth Sheldon-Coulson wrote: (Revised version: What characterizes an expression? Is it correct to say that an expression is always something for which seq? returns true and never something for which seq? returns false?) I don't think so. {:a :b}

Re: processing two collections

2010-02-15 Thread Glen Rubin
I tried using your alternate definition for palindromes? , but an exception was thrown: java.lang.NullPointerException [Thrown class java.lang.RuntimeException] On Feb 15, 7:02 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Feb 15, 2:50 pm, Glen Rubin rubing...@gmail.com wrote:  

Re: processing two collections

2010-02-15 Thread Meikel Brandmeyer
Hi, On Mon, Feb 15, 2010 at 01:07:15PM -0800, Glen Rubin wrote: I tried using your alternate definition for palindromes? , but an exception was thrown: java.lang.NullPointerException [Thrown class java.lang.RuntimeException] Works for me. However one has to wrap the first string into a

Re: leiningen powershell script

2010-02-15 Thread Brian Wolf
Rob Wolfe wrote: On 15 Lut, 20:50, Brian Wolf brw...@gmail.com wrote: Rob Wolfe wrote: On 15 Lut, 07:42, Brian Wolf brw...@gmail.com wrote: Hi, I am trying to run(http://bit.ly/82zo95http://bit.ly/82zo95 ) powershell script for leiningen install under windows,

Re: newbie question: Please help me stop creating constructors

2010-02-15 Thread Sean Devlin
Let's start with what you've got. Could you post some of your code on github, or something similar? That would make it easier to help you along. Sean On Feb 15, 12:24 pm, Yaron ygol...@gmail.com wrote: I am writing a calculator to figure out if I should sell or rent my home using Clojure.

Re: newbie question: Please help me stop creating constructors

2010-02-15 Thread Richard Newman
So imagine the user submits a value A. I will have a value B whose definition will be something like (+ 1 A) (yes, more complex in reality, but you get the idea). In Java, everything's an object, so you go about this by defining some class. All of its private members, its constructors, and

Emacs/Slime -- Slime wont eval but *inferior-lisp* will (Help a newbie out)

2010-02-15 Thread joseph hirn
Hello. I've been trying to get emacs/slime running for a while on ubuntu 9.10. I used clojure box for Windows and that was excellent but this is not running very well for me. I compiled clojure and clojure-contrib.jar by cloning the repositories, checking out tag 1.1.0 and building them with ant.

Re: When to use loop recur / seq functions?

2010-02-15 Thread CuppoJava
Here's your second implementation cleaned up a little: (defn perimeter [ pn] (apply + (map euclidean-distance pn (rest pn My own personal opinion is: The second approach is (1) faster to write (2) easier to understand (3) less error-prone So that's the one that I prefer. IF the first

Re: Emacs/Slime -- Slime wont eval but *inferior-lisp* will (Help a newbie out)

2010-02-15 Thread Phil Hagelberg
On Mon, Feb 15, 2010 at 12:58 PM, joseph hirn joseph.h...@gmail.com wrote: Hello. I've been trying to get emacs/slime running for a while on ubuntu 9.10. I used clojure box for Windows and that was excellent but this is not running very well for me. I compiled clojure and clojure-contrib.jar

Re: processing two collections

2010-02-15 Thread ataggart
I think it'd be a good exercise to do this all without using strings. -- 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 from new members are moderated - please be patient with

Re: how to use with-bindings*

2010-02-15 Thread Michał Marczyk
On 15 February 2010 19:37, Аркадий Рост arkr...@gmail.com wrote: I don't understand the reason to make the argument binding-map: with-binding* is used in the definition of bound-fn*, which seems like a pretty useful thing to have. The reason it accepts a Var / value map is probably the fact that

Re: Emacs/Slime -- Slime wont eval but *inferior-lisp* will (Help a newbie out)

2010-02-15 Thread Steven E. Harris
joseph hirn joseph.h...@gmail.com writes: All seems to be well when I M-x slime, but if I enter (+ 1 2) it just hangs. If I switch to the *inferior-lisp* buffer and type this expression it returns 3 as expected. I have the same problem, as documented here:

Re: Question about how I got run?

2010-02-15 Thread Mike Meyer
On Sun, 14 Feb 2010 22:32:45 -0800 (PST) ataggart alex.tagg...@gmail.com wrote: On Feb 14, 6:47 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: So, the next question - possibly another name-space question. Is there any way to tell if inside a .clj file if it was invoked

Re: Question about how I got run?

2010-02-15 Thread Michał Marczyk
On 16 February 2010 02:12, Mike Meyer mwm-keyword-googlegroups.620...@mired.org wrote: To bad. It's really handy, especially as it starts trickling into system modules. You get one file that provides the simple command line usage plus functions that allow user to get to advanced usage. It also

Seattle clojure group

2010-02-15 Thread Phil Hagelberg
We've started a mailing list for our new Seattle group: http://groups.google.com/group/seajure Hop on the list if you're interested. -Phil -- 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

Re: how to use with-bindings*

2010-02-15 Thread Meikel Brandmeyer
Hi, On Feb 15, 7:37 pm, Аркадий Рост arkr...@gmail.com wrote: for example, using binding macro: (binding [a 5] ...do something...) ;;using vector to contain bindings. Beware the Leopard! user= (def a 5) #'user/a user= (declare b) #'user/b user= (binding [a 1 b (inc a)] b) 6 user= (let [a 1 b

iterator-seq runs over

2010-02-15 Thread Robert Campbell
(map handler (iterator-seq result-set)) always throws a NoSuchElementException (map handler (butlast (iterator-seq result-set))) always works. (count (iterator-seq result-set)) is returning the correct number of elements. Calls to first, second, nth, also work correctly. When I manually test a