On Wed, Nov 4, 2009 at 6:46 AM, John Harrop <[email protected]> wrote:
> On Tue, Nov 3, 2009 at 1:53 AM, Alex Osborne <[email protected]> wrote:
>>
>> The new loop uses the outer-let to get around this:
>> (let [G__13697 s
>> [x & xs] G__13697
>> y xs]
>> (loop* [G__13697 G__13697
>> y y]
>> (let [[x & xs] G__13697
>> y y]
>> ...)))
>
> Now, if that were
> (let [G__13697 (java.lang.ref.SoftReference. s)
> [x & xs] (.get G__13697)
> y xs]
> (loop* [G__13697 (.get G__13697)
> y y]
> (let [[x & xs] G__13697
> y y]
> ...)))
> instead ...
Or you can rely on the existing local clearing on tail calls:
(#(let [G__13697 s
[x & xs] G__13697
y xs]
((fn [G__13697 y]
(let [[x & xs] G__13697
y y]
...) G__13697 y))))
It _should_ work (untested).
Christophe
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en