Re: Using a monad's m-plus function inside a macro

2009-05-11 Thread Konrad Hinsen
On 11.05.2009, at 03:00, Rich Hickey wrote: Could you explain a bit why you needed to do this? I'm a bit concerned about libraries requiring symbol-macros. Here is a simplified view of how my monad library works. Each monad is an object that contains the definition of a few functions. Other

Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?

2009-05-11 Thread Stefan Hübner
On 10 Mai, 22:17, d...@kronkltd.net (Daniel E. Renfer) wrote: Phil Hagelberg p...@hagelb.org writes: Howard Lewis Ship hls...@gmail.com writes: clojure-lang because there will be a clojure-contrib artifact for the same group. And this is ... a bad thing? I'm lost. -Phil Good, at

implicit dosync?

2009-05-11 Thread Mark Engelberg
I'm curious, wouldn't it be possible for every ref-set to be implicitly wrapped in a dosync? That way, you wouldn't have to explictly wrap ref-set in a dosync for the times where you just want to change one ref. You'd only need to explicitly call dosync when you need to wrap more than one

Designing an SQL-based application

2009-05-11 Thread Janico Greifenberg
Hi, I'm writing an RSS-reader using compojure and clojure.contrib.sql. As this is my first project in a functional language, I'm not sure about how to design the application. The concrete question I'm having right now, is how to encapsulate database queries in functions. For my RSS-reader, a

Re: implicit dosync?

2009-05-11 Thread B Smith-Mannschott
On Mon, May 11, 2009 at 09:13, Mark Engelberg mark.engelb...@gmail.com wrote: I'm curious, wouldn't it be possible for every ref-set to be implicitly wrapped in a dosync?  That way, you wouldn't have to explictly wrap ref-set in a dosync for the times where you just want to change one ref.  

Re: stumped by class not found (vista)

2009-05-11 Thread James Reeves
On May 11, 4:42 am, tarvydas tarvy...@visualframeworksinc.com wrote: I added a full path to my working directory in the CLASSPATH environment variable (using the control panel) and that didn't appear to help. In order for gui.Mainframe to work, there needs to be a directory $d in your

Re: stumped by class not found (vista)

2009-05-11 Thread Terry Hannant
Hi You can use (. System getProperty java.class.path) - To check class path (. System getProperty user.dir) - Current working directory from your Slime REPL to check For using Slime and Clojure I recommend Bill Clementson's blog entry here: http://bc.tech.coop/blog/081205.html which has a

Re: Yet Another Swing Example

2009-05-11 Thread fendres
On May 8, 4:25 am, Curran Kelleher curran.kelle...@gmail.com wrote: Hello, I've posted an example of a simple model-view-controller GUI skeleton in Clojure here:http://lifeofaprogrammergeek.blogspot.com/2009/05/model-view-controll... The GUI has a text box and a panel which draws what you

Re: implicit dosync?

2009-05-11 Thread Rich Hickey
On May 11, 3:13 am, Mark Engelberg mark.engelb...@gmail.com wrote: I'm curious, wouldn't it be possible for every ref-set to be implicitly wrapped in a dosync? That way, you wouldn't have to explictly wrap ref-set in a dosync for the times where you just want to change one ref. You'd only

Re: Getting slime-edit-definition to work with Clojure

2009-05-11 Thread Shawn Hoover
On Fri, May 8, 2009 at 5:43 AM, Baishampayan Ghose b.gh...@ocricket.comwrote: Stephen C. Gilardi wrote: I've simplified my .emacs file and clojure launch script to only what's required for my slime setup to work with swank-clojure. With this simplified setup, I confirmed that slime's

Re: Using a monad's m-plus function inside a macro

2009-05-11 Thread Rich Hickey
On May 11, 2:40 am, Konrad Hinsen konrad.hin...@laposte.net wrote: On 11.05.2009, at 03:00, Rich Hickey wrote: Could you explain a bit why you needed to do this? I'm a bit concerned about libraries requiring symbol-macros. Here is a simplified view of how my monad library works. Each

Re: Using a monad's m-plus function inside a macro

2009-05-11 Thread Konrad Hinsen
On May 11, 2009, at 15:03, Rich Hickey wrote: I have to admit to not having had time to go through your monad code in detail, but I'd like to ask the general question: Why not use dynamic binding in a Clojure implementation of monads? That is an option I had considered, but quickly

Re: Clojure talk in NYC May 12

2009-05-11 Thread Tom Hickey
In case anyone was looking for updated info, it can be found here: http://www.lispnyc.org/home.clp On Apr 29, 11:16 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: Hi, Clojurians, I'll be talking about my work with Clojure at LispNYC on Tuesday, May 12. Time (evening) location to be

Re: HTTP clients in clojure

2009-05-11 Thread Perry Trolard
Let me know if you find it useful. I would love to get some comments. -Phil Hi Phil, I'm trying out clojure-http-client, thus far I like the idea of it quite a bit: a simple but clever wrapper on built-in JDK APIs, so provides convenience w/o the burden of external jars. Quickly, I ran into

Re: Add JNDI lookup support for contrib/sql

2009-05-11 Thread Stephen C. Gilardi
On May 9, 2009, at 2:33 AM, Mark Derricutt wrote: Can we add the following to contrib's sql namespace, it simply adds jndi as a db-spec scheme ( I also raised this as http://code.google.com/p/clojure-contrib/issues/detail?id=39 , which google decided to set as a defect and I can't change):

Re: Designing an SQL-based application

2009-05-11 Thread Sean Devlin
Here are my thoughts on the three approaches: Approach #1: This seems the most straightforward. I'd write a function that takes a map of conditions, and returns a list of tuples. You can then do what you want with the list of tuples. Approach #2: Remember the first rule of macro club:

Re: Designing an SQL-based application

2009-05-11 Thread Victor Rodriguez
On Mon, May 11, 2009 at 11:32 AM, Sean Devlin francoisdev...@gmail.com wrote: Here are my thoughts on the three approaches: Approach #1:  This seems the most straightforward.  I'd write a function that takes a map of conditions, and returns a list of tuples.  You can then do what you want

[ANN] Moustache, a micro web framework

2009-05-11 Thread Christophe Grand
Hi all! I'm happy to announce the public release of Moustache a micro web framework whose sole purpose is to ease composing Ring handlers and middlewares (hence you can mix Compojure and Moustache). The mandatory hello-world: (app [hi] {:get Hello group!}) I wrote a quick walk-through:

Re: Designing an SQL-based application

2009-05-11 Thread Sean Devlin
Okay, good point about approach #2. As I mentioned earlier, I'd use approach #3 first. Here's how I'd write your macro as a function (defn process-feeds [feeds body] (body feeds)) And I'd call it like this (process-feeds (get-feeds-s-exp ...) (fn [feeds] body)) The first thing I'd like

binding inside loop

2009-05-11 Thread Vincent Akkermans
Hi all, I'm building an application in which I want some function calls to be logged. However, when I have function A and B (both will be logged) and A is called from B, I want the log to show this relation. I defined a small macro for this purpose: (def *hierarchy* []) (def *action-id* nil)

Does ProGuard work with clojure?

2009-05-11 Thread Andreas Franke
Hello! Since I'm new to this group, let me say that recently I got interested in clojure, coming from Mozart/Oz, Common Lisp, and scheme. And I like it. A lot, in fact.:) Now... does anyone know whether ProGuard works with clojure? (I'm using proguard4.4beta2 with clojure 1.0.0.RC1.) In the

Re: binding inside loop

2009-05-11 Thread Rich Hickey
On May 11, 2:20 pm, Vincent Akkermans vincent.akkerm...@gmail.com wrote: Hi all, I'm building an application in which I want some function calls to be logged. However, when I have function A and B (both will be logged) and A is called from B, I want the log to show this relation. I

Re: Yet Another Swing Example

2009-05-11 Thread billh04
Not sure about the alt+f4, but to have the application quit when the last window is closed, look at achiFrameAdapter in the code at the following url: http://tiny.cc/2FkMf. The application is setup to track multiple windows being opened, and when there are no more windows, the

Re: Yet Another Swing Example

2009-05-11 Thread Curran Kelleher
for those interested: http://curransoft.com/code/clj-grapher-20090511.zip It's an intermediate stage of a larger project which will eventually involve parsing a simple math language and rendering a 3D surface using OpenGL. I've learned a lot from progressing thus far and thought I'd share some thoughts

More trouble with m-seq in a macro

2009-05-11 Thread samppi
I'm having trouble using clojure.contrib.monads/m-seq in a macro. Let's say that I just want to create a macro version of m-seq. Clojure 1.0.0- user= (use 'clojure.contrib.monads) nil user= (with-monad maybe-m (m-seq [1 2 3])) (1 2 3) user= (defn a [ xs] (with-monad maybe-m (m-seq [1 2 3])))

CANCELED: Clojure talk at LispNYC May 12

2009-05-11 Thread Stuart Sierra
Hi folks, I just found out that my presentation for tomorrow has been canceled, due to problems with the venue. But LispNYC will still be meet at the Sunburnt Cow, 137 Avenue C between 9th 10th Streets. I'll be there to talk about Clojure over drinks. My presentation has been postponed to

Re: stumped by class not found (vista)

2009-05-11 Thread tarvydas
On May 11, 2:07 am, Terry Hannant thann...@gmail.com wrote: Hi You can use (. System getProperty java.class.path) - To check class path (. System getProperty user.dir) - Current working directory from your Slime REPL to check Thanks. For future reference: my problem was based on a

Re: stumped by class not found (vista)

2009-05-11 Thread Shawn Hoover
On Mon, May 11, 2009 at 7:13 PM, tarvydas tarvy...@visualframeworksinc.comwrote: - Where does the output from println go? I put println's in the proxy callbacks, but I don't see the output in the slime repl nor in the *Messages* buffer (I know that the callbacks are working, because they

Re: stumped by class not found (vista)

2009-05-11 Thread Terry Hannant
On Tue, May 12, 2009 at 8:43 AM, tarvydas tarvy...@visualframeworksinc.comwrote: - Why does closing the test gui cause slime to stop? Most likely because your app has the default close operation to be JFrame.EXIT_ON_CLOSE Thus when you close the gui the JVM exits, which is the same JVM that

Re: Yet Another Swing Example

2009-05-11 Thread Curran Kelleher
Aha! I discovered a solution to the window-closing problem mentioned above: calling (.dispose frame) on the window closing event will cause the application to exit when running independently (I guess because it causes everything to be garbage collected thus the VM terminates (?) ) , but doesn't

Re: Macros applied to entire programs

2009-05-11 Thread Sean Devlin
Macros are definitely the tool to do this. Take a look here at Paul Graham's The Roots of Lisp. In it you'll get an idea of why eval is so powerful, and why macros are exactly the tool for the job you're thinking of. http://lib.store.yahoo.net/lib/paulgraham/jmc.ps I'll let someone else

Re: Macros applied to entire programs

2009-05-11 Thread Mark Reid
Hi, I have read Graham's On Lisp. That, and my background in Java and Haskell programming were the main reasons I was drawn to Clojure. Based on that article and others like it I had the impression that program transformations like the one I suggested were relatively easy in homoiconic languages