[plt-scheme] Make multiple attempts to open DrScheme join running process?

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Feb 26 13:56:24 EST 2007

On Feb 25, Todd O'Bryan wrote:
> On Sun, 2007-02-25 at 21:09 -0600, Matthew Flatt wrote:
> > Surely you mistyped the program? That should run in constant space.
> > 
> > But
> > 
> >  (define (recur x) 
> >    (add1 (recur x)))
> >  (recur 7)
> > 
> > should indeed use unbounded memory (and DrScheme executes it very
> > "efficiently" :).
> 
> Whoops! You're right. The program I used to do testing was actually:
> 
> (define (recur x)
>   (cons x (recur x)))
> 
> Not sure which of these is most efficient at eating up memory.

They's just as efficient -- in both cases you never get to apply the
procedure.  In languages that permit unbound identifiers, you could
just as well run

  (define (recur x)
    (blah (recur x)))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.