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,7d1a6bfc6489c17b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-06 06:54:52 PST Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!arclight.uoregon.edu!vixen.cso.uiuc.edu!howland.erols.net!panix!yellow.newsread.com!netaxs.com!newsread.com!POSTED.newshog.newsread.com!not-for-mail Message-ID: <39B64E94.F081DCAB@telepath.com> From: Ted Dennison X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; I) X-Accept-Language: en,pdf MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: exiting a bloc References: <39B15EA8.88DB58AB@netcourrier.com> <8orprn$b46$1@nnrp1.deja.com> <39B532CB.73D359F8@ix.netcom.com> <39B5A8B0.56D674C6@telepath.com> <39B6114B.2929FA58@amsjv.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 06 Sep 2000 13:54:27 GMT NNTP-Posting-Host: 38.195.186.125 X-Complaints-To: Abuse Role , We Care X-Trace: newshog.newsread.com 968248467 38.195.186.125 (Wed, 06 Sep 2000 09:54:27 EDT) NNTP-Posting-Date: Wed, 06 Sep 2000 09:54:27 EDT Organization: Telepath Systems (telepath.com) Xref: supernews.google.com comp.lang.ada:523 Date: 2000-09-06T13:54:27+00:00 List-Id: Philip Anderson wrote: > Ted Dennison wrote: > > > > arrays (particularly strings) dynamicly on the stack. I think I've also used > > them in the "accept" alternatives of server tasks or in branches of large > > command-processing case statements to declare local variables that are > > unique to that alternative. > > anyway - no dynamic arrays, tasks or exceptions. Branches of case > statements could arise, but it would seem more readable to call a > procedure if one is that complicated. That's quite true for a complicated branch. But I wasn't talking about a complicated branch. I was talking about a simple branch in a large case statement (like one I wrote for a embedded device using Alsys's SPARK compiler :-). This kind of thing happens in command processors a lot. Many of the branches may need variables that no other branch requires. You could make each small branch a subprogram. But that would give you tons of little 3-line subprograms, and you *still* have the huge case statement. Of course one way to handle this now is to use tagged types and dynamic dispatching. But if the commands come in from outside the Ada system (as they did in the system I mentioned above) that won't work. There's no simple way to convert a command ID into a tagged type's tag. I'd also dispute the idea that since SPARK disallows a lot of Ada constructs, its OK to disallow more of them by fiat. To the contrary, I think you *need* all the language features you can get in SPARK. For instance, pointers are *not* disallowed in SPARK (at least not by the compiler I used). The allocator "new" was not available, but that's not the same thing. But I found it invaluable to be able to use pointers (which I acquired by unchecked_conversion'ing addresses). Many other developers on the project acted as if pointers were prohibited. So they had to achieve the same effect using "for use at" overlays, which caused no end of troubles during integration (in addition to being erronious code when the types weren't always the same). -- T.E.D. Home - mailto:dennison@telepath.com Work - mailto:dennison@ssd.fsi.com WWW - http://www.telepath.com/dennison/Ted/TED.html ICQ - 10545591