Sorry for the second mail - I've just improved the macro so server is
only evaluated once (It's side-effect save now)

On Sun, Jun 13, 2010 at 9:50 PM, Moritz Ulrich
<ulrich.mor...@googlemail.com> wrote:
> Huh? I don't see why I wire server at macro expansion time. You can
> pass a variable and it'll be integrated in the emitted code.
>
> (with-server (concat "http://"; "localhost" ":5984")
>  (database-list))
>
> will expand to
>
> (binding [database-list (partial database-list (concat "http://";
> "localhost" ":5984"))]
>   (database-list))
>
> On Sun, Jun 13, 2010 at 9:36 PM, Meikel Brandmeyer <m...@kotka.de> wrote:
>> Hi,
>>
>>
>> On 13 Jun., 19:55, Moritz Ulrich <ulrich.mor...@googlemail.com> wrote:
>>
>>> This was in the original branch of the clojure-couchdb-project. I
>>> forked it and rewrote all functions to take an argument instead of
>>> using *server*.
>>>
>>> This annoyed me, because it was complicated to use multiple servers
>>> with one codebase (binding is annoying in multi-thread-applications).
>>
>> But your idea doesn't improve things, no? You hard-wire the server at
>> macro expansion time. So using multiple servers doesn't work at all.
>> At least not easily. I still prefer the double approach. Bind *server*
>> or pass it as an argument. You can add even another level of
>> indirection. Make *server* an atom and set it once a startup. Then you
>> don't even need binding. For local required different server you can
>> use binding for a bunch off functions, you don't control. Or pass in a
>> server if do control the code.
>>
>> Sincerely
>> Meikel
>>
>> --
>> 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
>> Note that posts from new members are moderated - please be patient with your 
>> first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>
> --
> Moritz Ulrich
> Programmer, Student, Almost normal Guy
>
> http://www.google.com/profiles/ulrich.moritz
>



-- 
Moritz Ulrich
Programmer, Student, Almost normal Guy

http://www.google.com/profiles/ulrich.moritz

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to