Re: regex literal syntax

2008-10-10 Thread Christophe Grand
Chouser a écrit : > On Thu, Oct 9, 2008 at 4:57 PM, Rich Hickey <[EMAIL PROTECTED]> wrote: > >> Go for it. >> > > (defmethod print-method java.util.regex.Pattern [p #^Writer w] > (.write w "#\"") > (loop [[#^Character c & r :as s] (seq (.pattern #^java.util.regex.Pattern > p))] >

Re: Casting java arguments...

2008-10-10 Thread mritun
On Oct 10, 1:46 am, Luc Prefontaine <[EMAIL PROTECTED]> wrote: > I found a workaround... > > I was able to register the driver using > -Djdbc.drivers=com.mysql.jdbc.Driver on the java command line. > Looks like loading the class is not enough, adding the above does work: > > user=> (enumeration-

Re: regex literal syntax

2008-10-10 Thread Chouser
On Fri, Oct 10, 2008 at 4:07 AM, Christophe Grand <[EMAIL PROTECTED]> wrote: > > Hello Chouser, (btw, nice work you are doing with ClojureScript) Thanks -- good to see you around again! > Do you plan to support printing of all Pattern instances or only those > created using the new literal synta

help a journalist: why Clojure?

2008-10-10 Thread estherschindler
I'm doing an article for CIO.com on "5 [or whatever] languages that ought to be on your [IT Manager's] radar," and I'd like to include Clojure. I'm looking for a short statement on why it's useful, and why the boss ought to let you use it for enterprise work. Any takers? This is meant to be a sho

Re: GUIs in Clojure

2008-10-10 Thread David Powell
> I'm just delving into the details of how Swing is implemented at > the moment, can't say I agree with half of the "design" decisions > myself. Swing isn't thread safe, although AWT is to my knowledge, Actually, AWT isn't thread-safe either. Documentation about the fact seems pretty hard to fi

Re: help a journalist: why Clojure?

2008-10-10 Thread Rastislav Kassak
I guess you should emphasize it's Lisp thus it has unbelievable long term compressibility of code thanks to macros and metaprogramming. However, it's still 1st class JVM citizen so seamlessly integrable with Java EE technologies and that other java stuff running today. It's exactly the reason I l

Re: help a journalist: why Clojure?

2008-10-10 Thread J. McConnell
My "try to sell it to someone's boss approach": The most pressing issue in software development today is how to better take advantage of multi-core CPU's to increase performance and reduce energy costs. Clojure provides a fundamentally better approach (in terms of ease and safety) to concurrency

Re: help a journalist: why Clojure?

2008-10-10 Thread Chouser
On Fri, Oct 10, 2008 at 8:32 AM, estherschindler <[EMAIL PROTECTED]> wrote: > > This is meant to be a short-and-sweet article: just its name, URL, a > quick formal definition, and then one or two quotes from developers > about why they think it's valuable. Imagine that you're trying to > convince

Re: help a journalist: why Clojure?

2008-10-10 Thread Stuart Halloway
Clojure: - Reach and performance of Java - Elegance of Ruby* - Scales like nothing else** *Lisp would be more accurate than Ruby, but managers have probably been hearing more about Ruby than Lisp. ** (Functional Programming + Software Transactional Memory) = Multicore applications programmed

Re: help a journalist: why Clojure?

2008-10-10 Thread estherschindler
That's *perfectly* pithy! On Oct 10, 6:41 am, Chouser <[EMAIL PROTECTED]> wrote: > On Fri, Oct 10, 2008 at 8:32 AM, estherschindler > > <[EMAIL PROTECTED]> wrote: > > > This is meant to be a short-and-sweet article: just its name, URL, a > > quick formal definition, and then one or two quotes fro

Re: "if" small syntax change proposal

2008-10-10 Thread James Reeves
On Oct 9, 10:29 pm, Dmitri P <[EMAIL PROTECTED]> wrote: > Allow cond-like specification of expression pairs and allow odd number > of expressions. Let odd expressions in last position serve as default > return value. There will be no impact on previous reading/writing of > "if". Stolen from Paul G

Re: Bug in r1057? Var reader macros in syntax quotes

2008-10-10 Thread Rich Hickey
On Oct 10, 6:03 am, Achim Passen <[EMAIL PROTECTED]> wrote: > Hi! > > There seems to be a problem with the new LispReader$VarReader: > > ; r1057 > user=> `#'clojure/doc > java.lang.UnsupportedOperationException: Vars are not values > (NO_SOURCE_FILE:0) > > ; r1056 > user=> `#'clojure/doc > (var

Re: "if" small syntax change proposal

2008-10-10 Thread Jeff V
The current cond does allow "else" behavior. It's done using a final test that evaluates to something non-false and non-nil, such as the keyword :else. That said, the proposed arc/newlisp style if macro would be more tidy. Jeff - Original Message - From: James Reeves <[EMAIL PROTECTED]

Bug in r1057? Var reader macros in syntax quotes

2008-10-10 Thread Achim Passen
Hi! There seems to be a problem with the new LispReader$VarReader: ; r1057 user=> `#'clojure/doc java.lang.UnsupportedOperationException: Vars are not values (NO_SOURCE_FILE:0) ; r1056 user=> `#'clojure/doc (var clojure/doc) This only happens for bound Vars, which are no longer wrapped when re

ANN: Clojure book

2008-10-10 Thread Stuart Halloway
Hi all, I am working on what I hope will become the first Clojure book in print: http://www.pragprog.com/titles/shcloj/programming-clojure If you are interested in being a reviewer please let me know off-list. Regards, Stuart --~--~-~--~~~---~--~~ You received

Re: Bug in r1057? Var reader macros in syntax quotes

2008-10-10 Thread Perry
Not sure exactly how this is related, but r1058 still gives me the following error that popped up after r1057. Compojure defines this macro: (defmacro redef "Redefine an existing value, keeping the metadata intact." [name value] `(let [m# (meta #'~name) v# (def ~name ~value)]

Re: error in slime with svn 1057

2008-10-10 Thread Mike Hinchey
fixed in svn 1058. 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 To unsubscribe from this group, send email to [EMAIL PROTECTED]

Re: ANN: Clojure book

2008-10-10 Thread Raoul Duke
hi Stuart, A book sounds great! Thank you for taking on such a project for the community :) I'd be very interested in reviewing. Even more usefully for you, I would suggest hooking up with the Silicon Valley Patterns group which Russ and Tracy lead (although I haven't been attending recently due

Re: help a journalist: why Clojure?

2008-10-10 Thread .Bill Smith
Java is a great language but the programming community has matured beyond what Java provides. At the same time, the Java community has a huge collection of mature class libraries. Clojure interoperates with those class libraries in a seamless way, much better than other JVM- based languages I've

Re: help a journalist: why Clojure?

2008-10-10 Thread John Hodge
It would be best to ask Rich Hickey. I could try to distill what Rich says in the Rationale, but it would be better coming from him. On Fri, Oct 10, 2008 at 8:32 AM, estherschindler <[EMAIL PROTECTED]>wrote: > > I'm doing an article for CIO.com on "5 [or whatever] languages that > ought to be on

Re: two dimensional arrays

2008-10-10 Thread Martin DeMello
On Oct 9, 12:29 pm, "Mark H." <[EMAIL PROTECTED]> wrote: > a mapping.  However, if you find yourself doing this a lot, you might > want to think about a more Clojure-like idiom that doesn't require > destructive updates and minimizes consing for local changes (e.g., a > quadtree). Interesting ide

Re: Casting java arguments...

2008-10-10 Thread Michael Wood
On Fri, Oct 10, 2008 at 11:45 AM, mritun <[EMAIL PROTECTED]> wrote: > > On Oct 10, 1:46 am, Luc Prefontaine <[EMAIL PROTECTED]> > wrote: [...] >> The mysql jdbc driver code says that it registers itself (static block) >> but something is wrong. >> Eventually I will find why but now I have other pr

Trying to run Clojure with Slime...

2008-10-10 Thread Tayssir John Gabbour
Hi! When I attempt to run Slime, this error pops up in *inferior-lisp*: user=> java.lang.UnsupportedOperationException: Vars are not values (basic.clj:12) user=> java.lang.Exception: No such var: swank/ignore-protocol-version (NO_SOURCE_FILE:5) user=> java.lang.Exception: No such var: swank/star

Get thread local bindings

2008-10-10 Thread ntupel
I still try to find a way to make threads inherit thread-local bindings established via binding in the parent thread. I searched for a function to get the thread bindings but couldn't find one. Did I miss anything? So I added getThreadBindings() to Var.java: diff --git a/trunk/src/jvm/clojure/lan

Re: Trying to run Clojure with Slime...

2008-10-10 Thread Mike Hinchey
Get the clojure from today. That error happened yesterday. -Mike --~--~-~--~~~---~--~~ 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 To unsubscribe from th

Re: Get thread local bindings

2008-10-10 Thread Mike Hinchey
swank-clojure has a similar issue, but solved by choosing explicitly which bindings to keep. It's usually advised to avoid eval. Of course, this only works for threads created by the specific macro. I suppose the vec of bindings to keep could be keep in a var to avoid repetition. (dothread-k

Re: help a journalist: why Clojure?

2008-10-10 Thread estherschindler
Actually, you guys gave me just what I needed. I don't think I have to ask for more! On Oct 10, 10:37 am, "John Hodge" <[EMAIL PROTECTED]> wrote: > It would be best to ask Rich Hickey.  I could try to distill what Rich says > in the Rationale, but it would be better coming from him. > > On Fri, O

Formatted printing?

2008-10-10 Thread Paul Stadig
I have a "database" that I'm working with that I'm loading using (def *db* (load-file "path-to-file/db.clj")) and saving using by basically opening a PrintWriter and using (pr-str *db*). The output to the file is a clojure data structure, but it is all on one line. Is there any existing code for

Re: GUIs in Clojure

2008-10-10 Thread Ande Turner
David, Thank you very much for such an expansive response. Currently a thread-safe Swing alternative is using the Jambi bindings for Qt. I neglected to provide a link to details before so here it is: http://doc.trollte

Re: regex literal syntax

2008-10-10 Thread Chouser
On Fri, Oct 10, 2008 at 7:48 AM, Chouser <[EMAIL PROTECTED]> wrote: > > Of course that means I need to do this for you when printing... I've attached an updated patch with a new print method, against the latest SVN 1058. If you really want to dig into the ugliness, here's a test I've been using.

Re: GUIs in Clojure

2008-10-10 Thread Ande Turner
Apologies Colin... I'll just say I was a victim of Trolltech marketing, that wasn't the impression I got. 2008/10/11 Colin Walters <[EMAIL PROTECTED]> > > On Oct 10, 4:42 pm, "Ande Turner" <[EMAIL PROTECTED]> wrote: > > David, > > Thank you very much for such an expansive response. Currently a

Re: GUIs in Clojure

2008-10-10 Thread Colin Walters
On Oct 10, 4:42 pm, "Ande Turner" <[EMAIL PROTECTED]> wrote: > David, > Thank you very much for such an expansive response.  Currently a thread-safe > Swing alternative is using the Jambi bindings for Qt. I neglected to provide Hmm? Qt isn't really any more threadsafe than Swing is, or than GTK+

Clojure, emacs, slime, swank tutorial for Ubuntu

2008-10-10 Thread solkis
I just created a basic clojure, emacs, slime, swank configuration tutorial for Ubuntu users (although hopefully it could be helpful to others as well.) This assumes a new Ubuntu installation (with no Java even) It's at a newb level since that's where I've been myself (with clojure, lisp) for the p

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

2008-10-10 Thread James Reeves
On Oct 10, 10:22 pm, solkis <[EMAIL PROTECTED]> wrote: > I just created a basic clojure, emacs, slime, swank configuration > tutorial for Ubuntu users I notice your tutorial uses JLine, which I've found to be rather iffy under Linux. Have you tried the REPL with rlwrap? Or haven't you had any pro

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

2008-10-10 Thread solkis
I haven't tried configuring the REPL scripts to use rlwrap. I'm mostly learning within emacs where it may be a moot point anyway (not sure.) I know in emacs I use Alt-p get get past forms. I'm definitely open to modifying this config tutorial to use rlwrap if it's more stable when needed (like dir

Re: GUIs in Clojure

2008-10-10 Thread John
Allegedly gnome-java is threadsafe, but it only works on Linux, unfortunately. http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/ On Oct 10, 5:20 pm, "Ande Turner" <[EMAIL PROTECTED]> wrote: > Apologies Colin...  I'll just say I was a victim of Trolltech marketing, > that

Macro expansion

2008-10-10 Thread JumpingJupiter
Like some other posters to this group, I thought it would be cool to have Clojure create a GUI based on a declarative definition. My plan was to use a recursive macro to handle the creation of nested swing objects and I found myself wanting to view the macro expansions. Unfortunately macroexpand a

Re: help a journalist: why Clojure?

2008-10-10 Thread Michel Salim
Coming from Scheme, at first my impression was "whoa, they removed a *lot* of parentheses!". So I guess it depends on where one's coming from. -- Michel On Oct 10, 1:22 pm, ".Bill Smith" <[EMAIL PROTECTED]> wrote: > I think the biggest initial complaint about Clojure will be "too many > parenth

Event Listeners in Functional Programming

2008-10-10 Thread CuppoJava
Hi guys, I'm getting started with Clojure, and I'm programming a small gui. The Java "idiom" for eg. a button, is to create a button object which contains a list of "event listeners (closures/callback functions)" that get called when the button is clicked. This sort of structure relies upon the

Re: Bug in r1057? Var reader macros in syntax quotes

2008-10-10 Thread Rich Hickey
On Oct 10, 12:34 pm, Perry <[EMAIL PROTECTED]> wrote: > Not sure exactly how this is related, but r1058 still gives me the > following error that popped up after r1057. Compojure defines this > macro: > > (defmacro redef > "Redefine an existing value, keeping the metadata intact." > [name va

Re: Event Listeners in Functional Programming

2008-10-10 Thread Chouser
On Fri, Oct 10, 2008 at 8:14 PM, CuppoJava <[EMAIL PROTECTED]> wrote: > > The Java "idiom" for eg. a button, is to create a button object which > contains a list of "event listeners (closures/callback functions)" > that get called when the button is clicked. So what is it you want the button to d

Re: GUIs in Clojure

2008-10-10 Thread Stuart Sierra
On Oct 8, 6:19 pm, "Michael Beauregard" <[EMAIL PROTECTED]> wrote: > This doesn't address the functional/stateless impedance mismatch, but > would make defining guis simpler. However, the basic idea is to > represent the containment hierarchy inherent in a gui with the nesting > of lisp expression

Re: GUIs in Clojure

2008-10-10 Thread Michael Beauregard
Part of why I didn't really follow through with this yet is that I'm actually not very interested in swing. After doing a 2 year contract using it I'm not sure I could use or recommend swing for anything substantial with a straight face. I find it clumsy and over complicated. Even still, it seems

Re: GUIs in Clojure

2008-10-10 Thread Michael Beauregard
I still don't really see why a multi-threaded UI framework is important. You can have a multiple threads use Swing's invokeLater(Runnable r) api to submit UI work. And since Clojure fns implement Runnable, you can just post fns into Swing to do your UI updates. I don't think you even *want* a mult

Re: GUIs in Clojure

2008-10-10 Thread Martin DeMello
On Oct 10, 9:08 pm, "Michael Beauregard" <[EMAIL PROTECTED]> wrote: > I still don't really see why a multi-threaded UI framework is > important. You can have a multiple threads use Swing's > invokeLater(Runnable r) api to submit UI work. And since Clojure fns > implement Runnable, you can just pos

Re: Formatted printing?

2008-10-10 Thread Michel Salim
On Oct 10, 4:37 pm, "Paul Stadig" <[EMAIL PROTECTED]> wrote: > I have a "database" that I'm working with that I'm loading using > > (def *db* (load-file "path-to-file/db.clj")) > > and saving using by basically opening a PrintWriter and using (pr-str *db*). > The output to the file is a clojure

Metadata on defmulti

2008-10-10 Thread Jeff V
Do multimethods support doc strings or other metadata? --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, se