Re: Formatted printing?

2008-10-11 Thread Paul Stadig
I'm using a clojure source file as a database, by loading the file modifying it then saving it back to the filesystem. I'm trying to keep things simple. It would be useful to pretty print it so I could inspect it and make small changes, if necessary. It seems like a rather simple problem, and I

Re: Get thread local bindings

2008-10-11 Thread ntupel
On Fri, 2008-10-10 at 12:46 -0700, Mike Hinchey wrote: It's usually advised to avoid eval. Many thanks Mike. I would like to avoid eval, but I am too stupid. However I would love to find out how to do it. If you could give me hunch I would be more than happy. See dothread-keeping in

#' use in clojure-contrib macros

2008-10-11 Thread Meikel Brandmeyer
Hi, I also ran in the problem with #' in a macro with clojure-contrib. The attached patch changes all macros in clojure-contrib to the suggested way with (var). Sincerely Meikel var-vs-reader.patch Description: Binary data smime.p7s Description: S/MIME cryptographic signature

Re: Formatted printing?

2008-10-11 Thread Rich Hickey
On Oct 11, 8:54 am, Paul Stadig [EMAIL PROTECTED] wrote: I'm using a clojure source file as a database, by loading the file modifying it then saving it back to the filesystem. I'm trying to keep things simple. It would be useful to pretty print it so I could inspect it and make small

Re: #' use in clojure-contrib macros

2008-10-11 Thread Rich Hickey
On Oct 11, 9:26 am, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Hi, I also ran in the problem with #' in a macro with clojure-contrib. The attached patch changes all macros in clojure-contrib to the suggested way with (var). Did you have a problem after rev 1059? I'm in the middle of

Re: Clojure, emacs, slime, swank tutorial for Ubuntu

2008-10-11 Thread Aaron Bedra
rlwrap seems to be a much better solution. I do use emacs as my daily driver, but it's nice to have a backup on the command line. I wrote a getting started article for Ubuntu a while back if you want to check it out. http://aaronbedra.com/2008/8/17/adventures-in-clojure-getting-started I made

Re: Event Listeners in Functional Programming

2008-10-11 Thread CuppoJava
Yeah, Clojure provides all that I need for GUI programming. I was just wondering if there's an elegant way of doing GUI in a pure- functional way, without mutability. On Oct 10, 7:58 pm, Chouser [EMAIL PROTECTED] wrote: On Fri, Oct 10, 2008 at 8:14 PM, CuppoJava [EMAIL PROTECTED] wrote: The

Re: #' use in clojure-contrib macros

2008-10-11 Thread Meikel Brandmeyer
Hi, Did you have a problem after rev 1059? I'm in the middle of making some reader changes - if rev 1059 works then I recommend leaving your code alone until I am done. At that point, I will know if I am going to change the promise of #'x becomes (var x), and let everyone know. Checked. The

BUG: resultset-seq breaks on duplicate column names

2008-10-11 Thread Allen Rohner
If you create a SQL query that returns duplicate names, resultset-seq throws an exception: java.lang.RuntimeException: java.lang.IllegalArgumentException: Too many arguments to struct constructor i.e. (let [rs (query select description,description from table)] (resultset-seq rs) The

What Windows IDE are you using?

2008-10-11 Thread CuppoJava
Hi guys, If anyone is using Windows, please share what environment you're using to program in. Currently I'm using Enclojure for Netbeans, but it's still new and a few features are broken. All I need is an IDE with: -method/parameter lookup (for clojure and java code) -syntax highlighting

Clojure Repl forcing lazy lists?

2008-10-11 Thread R. P. Dillon
I was noticing that a lazy list seems to get forced as soon as you create it on the Repl because printing it forces evaluation. (range 1 100), for example, produces: (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

Re: REPL does not print stack trace in some cases

2008-10-11 Thread Chouser
On Sat, Oct 11, 2008 at 1:26 PM, Allen Rohner [EMAIL PROTECTED] wrote: If you exercise the bug in my previous post about resultset-seq, the repl will not print a stack trace, it will only print the name of the exception and the message. That's a feature! I recent one, no less. Seriously,

Re: REPL does not print stack trace in some cases

2008-10-11 Thread Allen Rohner
It's odd to me that that the stack traces were only removed in a few instances. There are still plenty of places that do print traces. I'm all in favor of getting rid of the meaningless stack traces, once we have better error reporting. Allen On Oct 11, 2:36 pm, Chouser [EMAIL PROTECTED]

Re: Clojure Repl forcing lazy lists?

2008-10-11 Thread Rich Hickey
On Sat, Oct 11, 2008 at 2:40 PM, R. P. Dillon [EMAIL PROTECTED] wrote: I was noticing that a lazy list seems to get forced as soon as you create it on the Repl because printing it forces evaluation. (range 1 100), for example, produces: (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Re: REPL does not print stack trace in some cases

2008-10-11 Thread Chouser
On Sat, Oct 11, 2008 at 3:50 PM, Allen Rohner [EMAIL PROTECTED] wrote: It's odd to me that that the stack traces were only removed in a few instances. There are still plenty of places that do print traces. Such as where? I haven't seen any at the repl in a while. If a .clj file loaded from

Re: REPL does not print stack trace in some cases

2008-10-11 Thread Jim Menard
On Sat, Oct 11, 2008 at 6:14 PM, Chouser [EMAIL PROTECTED] wrote: On Sat, Oct 11, 2008 at 3:50 PM, Allen Rohner [EMAIL PROTECTED] wrote: It's odd to me that that the stack traces were only removed in a few instances. There are still plenty of places that do print traces. Such as where? I

A workaround for thread-local binding.

2008-10-11 Thread CuppoJava
Hi, I'm trying to do the following in Clojure, and I'm wondering if there's a better way... This creates a little window, with a button that prints my env whenever it is clicked. (ns main (:import (javax.swing JFrame JButton) (java.awt.event ActionListener))) (def env) (defn main