Re: Designing an SQL-based application

2009-05-12 Thread Janico Greifenberg
Thanks for your responses. I'm glad to see that I'm not entirely on the wrong track here. On Mon, May 11, 2009 at 6:39 PM, Sean Devlin wrote: > > 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 pro

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 t

Re: Designing an SQL-based application

2009-05-11 Thread Victor Rodriguez
On Mon, May 11, 2009 at 11:32 AM, Sean Devlin 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 with the list of tup

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: Don't

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 basi