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,92c39a3be0a7f17d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-14 04:12:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!server3.netnews.ja.net!south.jnrs.ja.net!server2.netnews.ja.net!newshost.central.susx.ac.uk!news.bton.ac.uk!not-for-mail From: John English Newsgroups: comp.lang.ada Subject: Re: Future with Ada Date: Thu, 14 Mar 2002 11:59:57 +0000 Organization: University of Brighton Message-ID: <3C9090BD.658FD79F@brighton.ac.uk> References: <3C7B0B13.3080003@worldnet.att.net> <3C7D1C89.2000803@home.com> <3C7E7CAD.7070504@mail.com> <3C7FB9D2.D9C6E055@boeing.com> <3C81DF1F.9000503@mail.com> <3C83A112.6080302@mail.com> <3C84223C.A356F466@adaworks.com> <3C853A04.34826F39@despammed.com> <3C8D0D70.BB09F3DA@despammed.com> <3C8F4571.3BE24266@brighton.ac.uk> NNTP-Posting-Host: straumli.it.bton.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: saturn.bton.ac.uk 1016107232 21621 193.62.183.204 (14 Mar 2002 12:00:32 GMT) X-Complaints-To: news@bton.ac.uk NNTP-Posting-Date: 14 Mar 2002 12:00:32 GMT X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:21217 Date: 2002-03-14T12:00:32+00:00 List-Id: Marin David Condic wrote: > > "John English" wrote in message > news:3C8F4571.3BE24266@brighton.ac.uk... > > > > I think I'd be tempted to use an array of access-to-procedures here. > > > That would certainly be an interesting approach and one that might greatly > simplify the code. But I'd imagine it might not work well in all cases - > where the branches might have common behavior for some set of the enumerals, Try: (a|b|c..d => Proc_1'Access, others => Proc_2'Access) > but with slight variations with specific cases, or where the procedure calls > needed different parameter lists, or any number of other things like that. Use little wrapper procedures which call the (parameterised) procedures. It's not a magic bullet, but it can produce more readable code in many (ahem ;-) cases. ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------