Looking for feedback on article about interactive programming / REPL

2010-09-20 Thread Thomas Kjeldahl Nilsson
Hello, Small request from a Clojure/Lisp-newbie: I wrote an article on interactive programming in order to really get REPL / interactive work. This style of development is new to me so I'm looking for any suggestions you might have for improvement/aspects which I've overlooked! The article (+

Re: Isn't STM good at building an ant colony?

2010-09-20 Thread Nicolas Oury
If you have a fixed geometry of cells, it is quite easy to have one ref per cell. Which reduce a lot of contention. For example, on a grid where ant can go instead of representing the world as a ref to a matrix, you can represent the world as a matrix of refs. Those refs can then be update

clojure.contrib.sql and duplicate inserts

2010-09-20 Thread Bart J
Currently, it is not possible to insert duplicate rows using the clojure.contrib.sql module (specifically, the insert-values method). Please let me know, if I can add this. Thanks. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: trace facility?

2010-09-20 Thread Jeff Rose
I'd recommend taking a look at the implementation of dotrace (last function in the file): http://github.com/richhickey/clojure-contrib/blob/master/src/main/clojure/clojure/contrib/trace.clj It let-binds a wrapper function for each of the functions you want to trace, so that within the context of

clojure friendly data warehouse stack

2010-09-20 Thread Jeff Rose
Hi, We are developing a data warehouse to facilitate reporting and data mining for cash register transaction data. It seems like many people in the Clojure community have data warehouse experience, so I wanted to ask for advice from people who have already done this before. Which libraries,

Re: Making Clojure really work with Google App Engine

2010-09-20 Thread Stefan Kamphausen
Hi, just a few days ago I started considering GAE for a (pet-)project. Being able to develop in Clojure on GAE seems like a valuable goal to me. For example, take a look at http://the-deadline.appspot.com which was written that way. So it might be a good idea to avoid creating threads

Re: clojure.contrib.sql and duplicate inserts

2010-09-20 Thread Stephen C. Gilardi
On Sep 20, 2010, at 8:27 AM, Bart J wrote: Currently, it is not possible to insert duplicate rows using the clojure.contrib.sql module (specifically, the insert-values method). Please let me know, if I can add this. Thanks. Are you saying you want to end up with duplicate rows or that

Re: trace facility?

2010-09-20 Thread Michael Wood
On 20 September 2010 14:55, Jeff Rose ros...@gmail.com wrote: I'd recommend taking a look at the implementation of dotrace (last function in the file): http://github.com/richhickey/clojure-contrib/blob/master/src/main/clojure/clojure/contrib/trace.clj clojure and clojure-contrib have moved

Re: why the big difference in speed?

2010-09-20 Thread Ranjit
Thanks Jason, this is great. I was confused earlier because I wasn't seeing reflection warnings, but it turns out that was only because I was evaluating the function definitions in the emacs buffer, and the warnings weren't visible. I have a question about gaussian-matrix3 though. What is aset-

Re: Can resultset-seq blow the stack?

2010-09-20 Thread Shantanu Kumar
Yeah this doesn't happen on using lazy-seq. Thanks! Shantanu On Sep 20, 8:52 am, Stephen C. Gilardi squee...@mac.com wrote: On Sep 19, 2010, at 3:45 PM, Shantanu Kumar wrote: I simulated a similar recursive call and found it throws StackOverflowError at 5508 levels deep on a 32-bit Sun JVM

Re: what's up with user.clj?

2010-09-20 Thread Laurent PETIT
BTW, shouldn't this user.clj trick be marked as deprecated, to be removed in a future version ? 2010/9/19 Kevin Downey redc...@gmail.com you can also run into issues with things being on the classpath for your project, but not being on the classpath for lein, but user.clj being on the

Evaluating elements of a vector in order

2010-09-20 Thread Quzanti
Hello I have a vector containing three macro calls. The third macro relies on the first having been fully evaluated. I want to define a macro to declare these three macros in order Call my vector 'stuff' then the following code inside a macro works (doall [(eval (get stuff 0)) (eval (get stuff

Re: concurrency example about java x clojure

2010-09-20 Thread Alan
A few days ago I was thinking about how different it would be to write flip-map* in Java vs Clojure. A very simple, small program, but easy to see how Clojure can be more expressive. public static MapV,K flipMap(MapK,V map) { MapV,K result = new HashMapV,K(map.size()); for (K key :

Clojure meetup group listing

2010-09-20 Thread Andrew Gwozdziewycz
Hey All, I know there are certainly a few groups out there (organized via Meetup.com or otherwise) which I see things posted about from time to time on the list. I'd like to propose that we make an effort to list these groups on Meetup Everywhere (http://www.meetup.com/everywhere), which is a

Re: why the big difference in speed?

2010-09-20 Thread Jason Wolfe
Oops, I found aset-double2 with tab completion and figured it was build-in. Forgot it was a utility I built some time ago, a stub for a Java method that does the setting. Also, I got the type hint for the arr arg wrong, although it didn't seem to matter. Here's a fixed version in standard

Re: concurrency example about java x clojure

2010-09-20 Thread Alan
Oh, I see you put the word concurrency in the subject but don't mention it in your post. I guess my example isn't interesting for you, then. You will get better responses if you put all relevant information in the actual body - the subject is a space to summarize the body, not to add to it. On

Re: concurrency example about java x clojure

2010-09-20 Thread John Cromartie
On Sep 20, 12:08 pm, Alan a...@malloys.org wrote: A few days ago I was thinking about how different it would be to write flip-map* in Java vs Clojure. A very simple, small program, but easy to see how Clojure can be more expressive. public static MapV,K flipMap(MapK,V map) {     MapV,K

Re: concurrency example about java x clojure

2010-09-20 Thread Alan
There's no such thing as a lazy map. into uses reduce, which is necessarily not lazy either. Clarity is in the eye of the beholder, of course. I think my version is clearer, but if you replaced second/first with val/key I'd rate them about the same. You might even replace (just val key) with

Re: concurrency example about java x clojure

2010-09-20 Thread Meikel Brandmeyer
Hi, Am 20.09.2010 um 18:52 schrieb John Cromartie: (def flip-map #(apply zipmap ((juxt vals keys) %))) If I was going to write flip-map it might be a tad longer, but lazy and a bit clearer (IMO), with: (defn flip-map [m] (into {} (map (juxt second first) m))) Is there some specific

Re: Clojure meetup group listing

2010-09-20 Thread Btsai
I second the motion. Just moved to Edmonton, and have been looking around for fellow Clojurians. I've created an Edmonton meetup (I think), and hopefully some kindred souls will turn up :) On Sep 20, 9:33 am, Andrew Gwozdziewycz apg...@gmail.com wrote: Hey All, I know there are certainly a

Re: Displaying source of function typed into the REPL?

2010-09-20 Thread Emeka
Sean, Try this, http://gist.github.com/193550 . Adjust it to your taste. Regards, Emeka On Mon, Sep 20, 2010 at 4:00 AM, Sean Corfield seancorfi...@gmail.comwrote: That also sounds pretty useful for development. I may try that as an exercise... This weekend has been a journey through The

Re: Displaying source of function typed into the REPL?

2010-09-20 Thread Sean Corfield
On Mon, Sep 20, 2010 at 11:09 AM, Emeka emekami...@gmail.com wrote: Try this, http://gist.github.com/193550 . Adjust  it to your taste. So I'd say (file-repl console.txt) and everything typed in and printed out would be written to that file for the REPL session? That would be a bit like the

Re: why the big difference in speed?

2010-09-20 Thread Ranjit
Replacing the doseq's with dotimes speeds it up a little more: (defn gaussian-matrix5 [^[[D arr] (dotimes [x (alength arr)] (dotimes [y (alength (first arr))] (aset-double ^doubles (aget arr (int x)) (int y) (next- gaussian) but I'm getting reflection warnings on alength. I guess

Re: [ANN] Leiningen 1.3.1

2010-09-20 Thread Eric Schulte
Hi, Having recently upgraded to this newest lein $ lein --version Leiningen 1.3.1 on Java 1.6.0_18 OpenJDK Client VM I notice that the lein swank command is no longer supported. $ lein swank That's not a task. Use lein help to list all tasks. What's the recommended way to start up a

Re: why the big difference in speed?

2010-09-20 Thread Jason Wolfe
I think partition is slowing you down (but haven't profiled to verify). Here's a functional version that's about 70% as fast as my 5: (defn gaussian-matrix6 [L] (to-array (for [i (range L)] (into-array Double/TYPE (for [j (range L)] (next-gaussian)) and I'd guess that's about as good

Re: Making Clojure really work with Google App Engine

2010-09-20 Thread Constantine Vetoshev
On Sep 20, 9:17 am, Stefan Kamphausen ska2...@googlemail.com wrote: So it might be a good idea to avoid creating threads automatically or importing file/socket packages. I think you're right. Dependencies are always a double-edged sword, and in the case of App Engine, they are more toxic than

[ANN] appengine-magic: using Clojure with Google App Engine

2010-09-20 Thread Constantine Vetoshev
I'd like to announce the release of a working version of appengine- magic, a library designed to make it easier to get started with Google App Engine using Clojure. appengine-magic abstracts away nearly all the boilerplate necessary to deploy an App Engine application. It also enables interactive

Re: concurrency example about java x clojure

2010-09-20 Thread Laurent PETIT
2010/9/20 Meikel Brandmeyer m...@kotka.de Hi, Am 20.09.2010 um 18:52 schrieb John Cromartie: (def flip-map #(apply zipmap ((juxt vals keys) %))) If I was going to write flip-map it might be a tad longer, but lazy and a bit clearer (IMO), with: (defn flip-map [m] (into {} (map

Re: [ANN] Leiningen 1.3.1

2010-09-20 Thread Phil Hagelberg
On Mon, Sep 20, 2010 at 12:08 PM, Eric Schulte schulte.e...@gmail.com wrote: Having recently upgraded to this newest lein  $ lein --version  Leiningen 1.3.1 on Java 1.6.0_18 OpenJDK Client VM I notice that the lein swank command is no longer supported. Hi Eric! The swank command is not

Re: appengine-magic: using Clojure with Google App Engine

2010-09-20 Thread Saul Hazledine
On Sep 20, 10:15 pm, Constantine Vetoshev gepar...@gmail.com wrote: I'd like to announce the release of a working version of appengine- magic, a library designed to make it easier to get started with Google App Engine using Clojure. appengine-magic abstracts away nearly all the boilerplate

Re: concurrency example about java x clojure

2010-09-20 Thread Meikel Brandmeyer
Hello Laurent. Am 20.09.2010 um 22:38 schrieb Laurent PETIT: The fact that currently having vals and keys return seqs in the same order is not guaranteed by the documentation ? Touché. Hard to swallow the own pill. It is not mentioned in the documentation, but it is chouser's believe that

Re: concurrency example about java x clojure

2010-09-20 Thread Laurent PETIT
2010/9/21 Meikel Brandmeyer m...@kotka.de Hello Laurent. Am 20.09.2010 um 22:38 schrieb Laurent PETIT: The fact that currently having vals and keys return seqs in the same order is not guaranteed by the documentation ? Touché. Hard to swallow the own pill. It is not mentioned in the

Re: [ANN] Leiningen 1.3.1

2010-09-20 Thread Andrew Gwozdziewycz
On Mon, Sep 20, 2010 at 3:08 PM, Eric Schulte schulte.e...@gmail.com wrote: Hi, Having recently upgraded to this newest lein $ lein --version Leiningen 1.3.1 on Java 1.6.0_18 OpenJDK Client VM I notice that the lein swank command is no longer supported. $ lein swank That's not a

Re: why the big difference in speed?

2010-09-20 Thread Ranjit
I'm glad you think partition is the problem, because that was my guess too. But I think I have the answer. This is the fastest version I've seen so far: (defn gaussian-matrix-final [L] (into-array ^doubles (map double-array (repeat L (repeatedly L next- gaussian) If I understand what's

Re: why the big difference in speed?

2010-09-20 Thread Ranjit
Actually it turns out the type hinting in gaussian-matrix-final isn't even necessary. I just took it out and the speed doesn't seem to change. On Sep 20, 7:43 pm, Ranjit rjcha...@gmail.com wrote: I'm glad you think partition is the problem, because that was my guess too. But I think I have the

Re: concurrency example about java x clojure

2010-09-20 Thread David Cabana
The fact that currently having vals and keys return seqs in the same order is not guaranteed by the documentation ? At the recent Pragmatic Studio class I asked Rich and Stuart about this very point. As I recall, Rich said vals and keys do behave as one would hope, so that for a map m we can

Re: Clojure meetup group listing

2010-09-20 Thread Miki
The L.A. one is at http://www.meetup.com/Los-Angeles-Clojure-Users-Group/ On Sep 20, 8:33 am, Andrew Gwozdziewycz apg...@gmail.com wrote: Hey All, I know there are certainly a few groups out there (organized via Meetup.com or otherwise) which I see things posted about from time to time on

Re: Clojure meetup group listing

2010-09-20 Thread Nick Brown
We've got one in the Raleigh area that, while not specific to Clojure, it is a common topic (along with other JVM based languages such as Scala and Groovy): http://www.meetup.com/TriJVM/ Though a Clojure specific meetup would be nice, I know for a fact there are other Clojure users here. On Sep

Clojure Serial Connection

2010-09-20 Thread Ivan Willig
I list, i am trying to connect to a USB GSM Modem with clojure. Basically, i want to open a serial connection to my modem and be able to pass commands to it. ( I think I am new to this whole modem thing). I know I can do this in Java, but wanted to check if someone had a working solutions in

Re: why the big difference in speed?

2010-09-20 Thread Jason Wolfe
On Sep 20, 4:43 pm, Ranjit rjcha...@gmail.com wrote: I'm glad you think partition is the problem, because that was my guess too. But I think I have the answer. This is the fastest version I've seen so far: (defn gaussian-matrix-final [L]   (into-array ^doubles (map double-array (repeat L

Re: what's up with user.clj?

2010-09-20 Thread Kevin Downey
user.clj is very useful, I'd rather keep it. On Mon, Sep 20, 2010 at 7:33 PM, Robert McIntyre r...@mit.edu wrote: If it is to be deprecated, is there a correct way of achieving the same result (having things automatically loaded when you create the repl?) --Robert McIntyre On Mon, Sep 20,

Re: what's up with user.clj?

2010-09-20 Thread Phil Hagelberg
On Mon, Sep 20, 2010 at 10:07 PM, Kevin Downey redc...@gmail.com wrote: On Mon, Sep 20, 2010 at 7:33 PM, Robert McIntyre r...@mit.edu wrote: If it is to be deprecated, is there a correct way of achieving the same result (having things automatically loaded when you create the repl?) user.clj

Re: concurrency example about java x clojure

2010-09-20 Thread Phil Hagelberg
On Mon, Sep 20, 2010 at 7:15 PM, David Cabana drcab...@gmail.com wrote: The fact that currently having vals and keys return seqs in the same order is not guaranteed by the documentation ? At the recent Pragmatic Studio class I asked Rich and Stuart about this very point. As I recall, Rich