Andrew, that code caused me to have headache some minutes ago :).
On Tue, May 12, 2009 at 6:43 PM, Emeka wrote:
> Why?
>
>
> On Tue, May 12, 2009 at 5:37 PM, Andrew Wagner wrote:
>
>> Wow. Ok, yeah, I'm glad he didn't put that version in the article :)
>>
>>
>> On Tue, May 12, 2009 at 1:17 PM, S
Oh, it's just significantly harder to read if you don't know clojure, that's
all.
On Tue, May 12, 2009 at 2:43 PM, Emeka wrote:
> Why?
>
>
> On Tue, May 12, 2009 at 5:37 PM, Andrew Wagner wrote:
>
>> Wow. Ok, yeah, I'm glad he didn't put that version in the article :)
>>
>>
>> On Tue, May 12, 20
Why?
On Tue, May 12, 2009 at 5:37 PM, Andrew Wagner wrote:
> Wow. Ok, yeah, I'm glad he didn't put that version in the article :)
>
>
> On Tue, May 12, 2009 at 1:17 PM, Stephen C. Gilardi wrote:
>
>>
>> On May 12, 2009, at 12:30 PM, Andrew Wagner wrote:
>>
>>> It seems like this idiom would be ea
Wow. Ok, yeah, I'm glad he didn't put that version in the article :)
On Tue, May 12, 2009 at 1:17 PM, Stephen C. Gilardi wrote:
>
> On May 12, 2009, at 12:30 PM, Andrew Wagner wrote:
>
>> It seems like this idiom would be easy to implement in this macro. Or am I
>> missing something?
>>
>
> The c
On May 12, 2009, at 12:30 PM, Andrew Wagner wrote:
It seems like this idiom would be easy to implement in this macro.
Or am I missing something?
The current implementation of clojure.core/with-open works with
multiple bindings the way you're advocating. The one in the article
makes for an
Hi,
Am 12.05.2009 um 18:56 schrieb Andrew Wagner:
Right, my question is why I can't do this:
(with-open [rdr (reader file) writer (get-writer) foo (get-a-foo)]
...)
In fact you can do and Clojure will close the Closables in
reverse order. The information you found is outdated.
Sincerely
Mei
The reason is because Clojure obeys arity to the letter and spirit. So if
you want to tweak the code to do that, just build you only macro to accept
that arity.
Emeka
On Tue, May 12, 2009 at 4:56 PM, Andrew Wagner wrote:
> Right, my question is why I can't do this:(with-open [rdr (reader file)
>
Right, my question is why I can't do this:(with-open [rdr (reader file)
writer (get-writer) foo (get-a-foo)]
...)
On Tue, May 12, 2009 at 12:51 PM, Emeka wrote:
> (with-open [rdr (reader file)]
> ...)
> So the vector you referred to is for binding and in imperative that means
> assignin
(with-open [rdr (reader file)]
...)
So the vector you referred to is for binding and in imperative that means
assigning rdr to function (reader file). So now it is pretty obvious that
what you need is the variable, rdr, (in side the scope) and that's why
clojure takes only the first element