I agree with the other commenters that letfn is good when you can use
it, but here you can't use it. Your general approach is really the
best you can do, though it's nicer to use promise/deliver than atom/
swap!, since these values are never going to change again.
I was looking for something
Dear all,
Is there a way to write something like:
(let [x (foo1 (fn [] (bar y)))
y (foo2 x)] )
where the y on line 1 refers to y in line 2?
I currently use an atom and an affectation to tie the loop...
Best,
Nicolas.
--
You received this message because you are subscribed to
letfn allows mutually recursive definitions. You could combine that with
trampoline.
Phil
Sent using thumbs, apologies for brevity
On May 29, 2012 6:54 PM, nicolas.o...@gmail.com nicolas.o...@gmail.com
wrote:
Dear all,
Is there a way to write something like:
(let [x (foo1 (fn [] (bar y)))
nicolas.o...@gmail.com nicolas.o...@gmail.com writes:
Hi Nicolas,
Is there a way to write something like:
(let [x (foo1 (fn [] (bar y)))
y (foo2 x)] )
where the y on line 1 refers to y in line 2?
You can define mutual recursive local functions using `letfn`, if that's
what
On May 29, 9:54 am, nicolas.o...@gmail.com nicolas.o...@gmail.com
wrote:
Is there a way to write something like:
(let [x (foo1 (fn [] (bar y)))
y (foo2 x)] )
where the y on line 1 refers to y in line 2?
I currently use an atom and an affectation to tie the loop...
I agree