Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!jinx From: jinx@zurich.ai.mit.edu (Guillermo J. Rozas) Newsgroups: comp.lang.scheme Subject: Re: Ports & GC Message-ID: Date: 29 Apr 91 19:25:16 GMT References: <480@data.UUCP> <9104291751.AA10911@cymbal.reasoning.com.> Sender: news@ai.mit.edu Reply-To: jinx@zurich.ai.mit.edu Organization: M.I.T. Artificial Intelligence Lab. Lines: 27 In-reply-to: gyro@cymbal.reasoning.COM's message of 29 Apr 91 17:51:47 GMT In article <9104291751.AA10911@cymbal.reasoning.com.> gyro@cymbal.reasoning.COM (Scott Layson Burson) writes: Somebody on this list recently alluded to "the well-known difficulty of defining UNWIND-PROTECT in the presence of firstclass continuations". I have long thought that what UNWIND-PROTECT ought to mean is that the cleanup actions are performed when the continuation in which they were established becomes garbage. That is not clear at all. The standard example of UNWIND-PROTECT (from CLtLII) is (unwind-protect (progn (start-motor) (drill-hole)) (stop-motor)) I don't think that waiting until the continuation is garbage to stop the motor is what the user intended. Sometimes you want it to happen on any exit from the protected action. Sometimes you want it to happen on "final" exit, whatever that means. As Ken points out, this really isn't all that hard to implement. The issue is not implementation, but what the correct behavior should be.