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

Re: Scheme mistakes (was Re: nil)



   Date: Thu, 14 Aug 2003 15:01:49 -0500
   From: Matt Hellige <matt@immute.net>
   Mail-Followup-To: ll1-discuss@ai.mit.edu

   [Alan Bawden <Alan@lcs.mit.edu>]
   > 
   > Consider evaluating:
   > 
   >   (throw (f x) 42)
   > 
   > Since you know that the expression `(f)' must yield a continuation, the
   > old continuation can be discarded (and perhaps reclaimed by the garbage
   > collector) -before- you call the function `f'.  If continuations just look
   > like procedures, then the programmer would have written:
   > 
   >   ((f x) 42)
   > 
   > is which case you don't know that the old continuation is going to be
   > discarded until -after- the call to `f' returns a continuation.

   Is this really true? What if `f' causes an error? Mightn't we need the
   old continuation to handle it correctly?

In pure R5RS Scheme I see no reason that old continuation can't be
discarded.