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,fb43c0ab08a05c0 X-Google-Attributes: gid103376,public From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) Subject: Re: Ada 83 Style Query Date: 1996/05/07 Message-ID: <4xrasxqu0q.fsf@leibniz.enst-bretagne.fr>#1/1 X-Deja-AN: 153380008 distribution: world sender: guerby@leibniz.enst-bretagne.fr references: <9605061517.AA05599@most> content-type: text/plain; charset=US-ASCII organization: Telecom Bretagne mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-05-07T00:00:00+00:00 List-Id: Wes writes : : I'm working on some old code that has a long string of elsif checking : strings that come in from outside against known commands. : : Seeking opinions on the desirability of using an enumerated type with 'VAL : and a case statement. The sore spot is the need for an exception handler : when the incoming string matches none of the literals in the command list. : : What would YOU do? And yes, "look the other way" is a viable answer. :-) Depending of what is on your priority list, other ways : - hcode table (you can try some automatic "best" hcode generators). - long list of imbricated "if", look at the GNAt lexical analysis routine. Hope this helps, -- -- Laurent Guerby, student at Telecom Bretagne (France), Team Ada. -- "Use the Source, Luke. The Source will be with you, always (GPL)." -- http://www-eleves.enst-bretagne.fr/~guerby/ (GATO Project). -- Try GNAT, the GNU Ada 95 compiler (ftp://cs.nyu.edu/pub/gnat).