guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: default stack size


From: Lynn Winebarger
Subject: Re: default stack size
Date: Sat, 06 Sep 2003 10:51:36 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

Joshua Judson Rosen wrote:
On Sat, Sep 06, 2003 at 05:33:21AM -0500, Lynn Winebarger wrote:
  Yeah, but why not get it in the right order:

(define (rep n)
 (let loop ((n n)
            (k (lambda (v) v)))
   (if (= n 0)
       (k '())
       (loop (- n 1)
         (lambda (v)
           (k (cons n v))))))

  Though reliance on the stack may be/is probably more efficient.  All this
version does is allocate the stack in the heap, one disconnected frame at a time.


... and you can also use an `if', as Lynn has demonstrated above.

Lynn, that's certainly an interesting point, but what's wrong with
just changing the direction in which the counter progresses? :)


   Well what fun would that be? ;)
   Plus I didn't catch that he was coming from (another) lisp, so I
took it as an opportunity to enlighten a newbie.

Lynn





reply via email to

[Prev in Thread] Current Thread [Next in Thread]