Re: Iteration in lisp



rigaha@xxxxxxxxx wrote:
If you want to iterate through a list, should you use a recursive
function or a loop?

If the recursive function defines a iterative process, it might be as good as a loop. If the loop defines a linear recursive process, it might be as bad as the recursive function.
.



Relevant Pages

  • Re: Any use for recursion?
    ... better done as a recursive function? ... ridiculous overhead in terms of execution speed and stack usage. ... that putchar is routed into a communications link that's running at 1 ... try writing that in a loop and making it easy to understand. ...
    (comp.programming)
  • RE: Recursive function help
    ... You could use a single query and return all employees sorted in to levels and use nested do while loops or a recursive function. ... > Microsoft VBScript runtime error '800a01fb' ... > Function GetParents() ...
    (microsoft.public.inetserver.asp.general)
  • Re: Recursive Functions
    ... requiring it as a recursive function does scream of homework. ... >> simple for loop should be easier and faster. ... > iterative version that can hold a candle to the recursive technique? ... multiplications are possible using the square and multiply idiom. ...
    (comp.lang.c)
  • Re: Iteration in lisp
    ... In Common Lisp, always prefer a loop where practical unless you know ... recursive function can run out of stack since CL does not guarantee ... Even if you have tail recursion, you are still wasting productivity by ...
    (comp.lang.lisp)