From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71daebeb6145ebb6 X-Google-Attributes: gid103376,public From: dewar@gnat.com Subject: Re: Stream venting (long) Date: 1998/12/31 Message-ID: <76g9ql$uvs$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 427475736 References: <768sng$6r9$1@nnrp1.dejanews.com> <769g3r$moq$1@nnrp1.dejanews.com> <76aor7$l4q$1@nnrp1.dejanews.com> <76baib$4ne$1@nnrp1.dejanews.com> <76de7d$opb$1@nnrp1.dejanews.com> <76dh6m$r63$1@nnrp1.dejanews.com> <76doir$1ek$1@nnrp1.dejanews.com> <76etuo$uel$1@nnrp1.dejanews.com> <368B6D96.D728F0B7@erols.com> X-Http-Proxy: 1.0 x1.dejanews.com:80 (Squid/1.1.22) for client 166.72.71.89 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Dec 31 16:47:17 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1998-12-31T00:00:00+00:00 List-Id: In article <368B6D96.D728F0B7@erols.com>, LeakyStain wrote: > You could implement a lock using a Controlled type, where > Initialize locks and Finalize unlocks, giving this usage: > > declare > Stream_Locker; > begin > stream use > end; > > That way, you don't have to worry about unlocking on > exceptions. I suspect Ted Dennison still won't be happy. I am not sure what would make Ted happy here, he seems to expect some kind of impossible magic :-) Note incidentally that internally, GNAT provides a cleanup handler possibility, the pseudo-syntax (e.g. that provided by -gnatG or -gnatdg in older versions) is begin ... at end ... end; and the stuff in the "at end" handler is guaranteed to be done on any exit from the block including an exceptional exit. We use this all the time for internal expansions, and it is tempting to make it available as a language extension (under control of the -gnatX switch of course :-) Robert Dewar Ada Core Technologies -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own