From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomas To: 9fans <9fans@cse.psu.edu> Subject: Re: [9fans] how to avoid a memset() optimization In-Reply-To: <1fa560a460cbfdccc20a37811f670fec@plan9.bell-labs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Wed, 20 Nov 2002 08:24:43 +0100 Topicbox-Message-UUID: 24865e5a-eacb-11e9-9e20-41e7f4b1d025 On Tue, 19 Nov 2002 at 9:32am, presotto@plan9.bell-labs.com wrote: > The exceptional style has its merits. If C had a resonable > multivalued return mechanism like alef or limbo, I think it > would have been a better solution. > > There's no reason other than personal preference to not use the > same model at user level, it's just a stack of long jmp > variables. However, I haven't found the need. Return values > seem to work just as well though they are much wordier. I've been fantasizing about having some sort of atreturn() functionality similar to atexit() to use in error handling (as soon as a file is opened, do an atreturn() and specify that that fd should be closed upon a "return -1;" but not otherwise, for example). Has anyone else been thinking in that direction? Does anyone have references to mailing list/usenet discussions or papers about such a feature? /Tomas