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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6ee8ca03c176d76 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-15 10:40:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp.flash.net!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr21.news.prodigy.com.POSTED!3bae8248!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: stupid question: how can I finish a program? References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 67.115.104.148 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr21.news.prodigy.com 1029433160 ST000 67.115.104.148 (Thu, 15 Aug 2002 13:39:20 EDT) NNTP-Posting-Date: Thu, 15 Aug 2002 13:39:20 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: OH\IRYOGTRUSP_@YMZJ\_Q\@TJ_ZTB\MV@BJ]Q]KEYUNDQUCCNSUAACY@L[ZX__HGFD]JBJNSFXTOOGA_VWY^_HG@FW_HUTHOH]TBPGCO\P^PLP^@[GLHUK@WLECKFVL^TYG[@RMWQXIWM[SDDYWNLG_G[_BWUCHFY_Y@AS@Q[B\APPF@DCZM_PG_VSCPQZM Date: Thu, 15 Aug 2002 17:39:20 GMT Xref: archiver1.google.com comp.lang.ada:28063 Date: 2002-08-15T17:39:20+00:00 List-Id: > forcing an Ada program to terminate?" The problem is that "terminate" is ambiguous. Do you mean terminate the current task? The task and all its children? All tasks in the program? Do you want Finalization to occur or not occur? All, or just some? If the code module that wants to terminate is in fact a reusable component, should it really terminate the whole program and all its tasks, or just the single component. What should happen when a procedure designed as a whole program is used instead as a single procedure in some larger program. Should the larger program terminate? I'm inclined toward raising an unhandled exception. That gives the overall program the option of an "others" handler to limit the "extent of termination". Of course it also means "others" shouldn't be used casually. One problem with a piece of code that aborts the environment task is that it might be called from some other task, which would then continue, with great confusion for all. Probably most people asking the question just want to terminate the single (environment) task in the simple program, with Finalization occurring, and an unhandled exception does that nicely.