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

Re: Scheme mistakes (was Re: nil)

[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?

(I really don't know, and am asking in all earnestness. I'm not trying
to troll or be sarcastic.)


Matt Hellige                  matt@immute.net