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,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: fjh@cs.mu.oz.au (Fergus Henderson) Subject: Re: Expressive Case Statements (was: Software landmines) Date: 1998/09/03 Message-ID: <6slkai$ju5$1@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 387423923 References: <902934874.2099.0.nnrp-10.c246a717@news.demon.co.uk> <6r1glm$bvh$1@nnrp1.dejanews.com> <6r9f8h$jtm$1@nnrp1.dejanews.com> <6renh8$ga7$1@nnrp1.dejanews.com> <6rf59b$2ud$1@nnrp1.dejanews.com> <6rfra4$rul$1@nnrp1.dejanews.com> <35DBDD24.D003404D@calfp.co.uk> <6sbuod$fra$1@hirame.wwa.com> <35f51e53.4 Organization: Computer Science, The University of Melbourne Newsgroups: comp.lang.ada Date: 1998-09-03T00:00:00+00:00 List-Id: eachus@spectre.mitre.org (Robert I. Eachus) writes: >"Dr Richard A. O'Keefe" writes: > > > Concerning decision tables, the EVALUATE statement in COBOL, > > and Robert I. Eachus's suggestion for doing them in Ada, > > I don't know what the COBOL standard says about EVALUATE, > > but there was one point about decision tables which seems > > to have been missed: > > > - as well as the condition *combinations* being complex, > > - the condition *elements* may be complex, and > > - you don't want to evaluate them if you don't have to... > > True, but from experience decision tables are not for situations >where evaluating all the decision variables is potentially harmful. Why is it potentially harmful? Do you mean because of the efficiency problem in such cases, or is there some other reason? I think Richard O'Keefe was pointing out an advantage of languages which support lazy evaluation. So unless there is some justification other than the efficiency problem, your statement above should be "from experience in languages which do not support lazy evaluation, ...", since in languages which *do* support lazy evaluation, decision tables can work fine as far as efficiency is concerned even in situations in which evaluating all the decision variables is potentially harmful. Richard's Clean program was an example of this. >There are often cases where you nest decision tables because some >predicates should only be evaluated in some cases. Too many don't >cares should also be taken as an indication that you have merged >tables that should be separate. Do you mean that to apply in general, or only to languages such as Ada which don't support lazy evaluation? If you mean it to apply in general, what's the justification? -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.