On Nov 30, 7:47 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Sun, Nov 30, 2008 at 5:52 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Any other solutions that would avoid a helper function? Not just
> > for my particular case, but anytime that one is calling recur from a
> > catch clause
On Sun, Nov 30, 2008 at 5:52 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Any other solutions that would avoid a helper function? Not just
> for my particular case, but anytime that one is calling recur from a
> catch clause?
Generally, collect the information you need from the catch cla
On Nov 30, 3:51 pm, "Michael Wood" <[EMAIL PROTECTED]> wrote:
> On Sun, Nov 30, 2008 at 9:29 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > On Nov 29, 7:52 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> >> On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote:
>
> >> > Even if you don't think y
On Sun, Nov 30, 2008 at 9:29 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> On Nov 29, 7:52 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
>> On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote:
>>
>> > Even if you don't think you'll run into the possibility of blowing
>> > your stack, it's still a
On Nov 29, 7:52 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote:
>
> > Even if you don't think you'll run into the possibility of blowing
> > your stack, it's still a good idea to use recur when doing tail call
> > recursion. The compiler will help you
>
> (defn construct-atom
> "translates a number n into an set of letters of size n"
> [construct length]
> (if (< (count construct) length)
> (recur (conj construct (char (+ (rand-int amino_acids) 65))) length)
> construct))
>
> recur will goto the nearest enclosing loop or fn.
>
>
As often as this comes up, I wonder if TCO and loop/recur deserve
their own section in the reference section.
Bill
On Nov 29, 4:11 am, "Kevin Downey" <[EMAIL PROTECTED]> wrote:
> the jvm does not do TCO, loop/recur allows for functional looking
> recursion on the jvm with constant stack size.
>
On Nov 29, 2008, at 6:49 AM, Daniel Renfer wrote:
> Even if you don't think you'll run into the possibility of blowing
> your stack, it's still a good idea to use recur when doing tail call
> recursion. The compiler will help you out by making sure it really is
> a tail call.
>
> Remember, recur
Even if you don't think you'll run into the possibility of blowing
your stack, it's still a good idea to use recur when doing tail call
recursion. The compiler will help you out by making sure it really is
a tail call.
Remember, recur isn't just for loop. It works with functions too.
On Sat, Nov
In this case, the depth of the recursion would be at maximum 21
(number of different types of amino acids), and the function itself
not often called. Is stack size something to worry about at those
depths?
On Nov 29, 11:11 am, "Kevin Downey" <[EMAIL PROTECTED]> wrote:
> the jvm does not do TCO, l
the jvm does not do TCO, loop/recur allows for functional looking
recursion on the jvm with constant stack size.
On Sat, Nov 29, 2008 at 1:25 AM, bOR_ <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I wondered if there is a difference between using loop-recur or merely
> writing a recursive function. T
Hi all,
I wondered if there is a difference between using loop-recur or merely
writing a recursive function. The main difference I found thus far was
that the loop-recur can suffice with less arguments, but the recursive
functions seem to be shorter, and perhaps more elegant?
(defn construct-ato
12 matches
Mail list logo