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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no 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-13 19:35:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3C901A57.FC90C430@despammed.com> From: Wes Groleau Reply-To: wesgroleau@despammed.com X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,es-MX,es,pt,fr-CA,fr MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Future with Ada 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 13 Mar 2002 22:34:47 -0500 NNTP-Posting-Host: 151.168.144.162 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 1016076910 151.168.144.162 (Wed, 13 Mar 2002 22:35:10 EST) NNTP-Posting-Date: Wed, 13 Mar 2002 22:35:10 EST Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:21187 Date: 2002-03-13T22:34:47-05:00 List-Id: > > I think I'd be tempted to use an array of access-to-procedures here. > > > That would certainly be an interesting approach .... > The technique you suggest hadn't occurred to me & I could see it as useful > and probably a good idea for a lot of cases. I just wouldn't imagine it It's a super way to make a state machine. If the inputs can be enumerated, and the states can be enumerated, then you have a two-dimensional array, indexed by current state and input. Each element is a record containing next state and transition action procedure pointer. Logic is just a tight loop looking up what to do and next state. Aggregate to initialize the array can be laid out easily in a tabular format suitable for documentation-- or copied _from_ the requirements. -- Wes Groleau http://freepages.rootsweb.com/~wgroleau