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

Re: Scheme mistakes (was Re: nil)



From: "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'.  

(throw (call-with-current-continuation (lambda (c) ...)) 42)