From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,8be18979db11f51c X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,fb631c9316319fef X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2001-02-28 10:14:04 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!newsengine.sol.net!hammer.uoregon.edu!canoe.uoregon.edu!logbridge.uoregon.edu!newsfeed.mesh.ad.jp!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!kilgallen From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Newsgroups: comp.os.vms,comp.sys.dec Subject: Re: Drop C/C++ better sooner than later Message-ID: References: <87n1baae6s.fsf@prep.synonet.com> <97bm3a$7tv@gap.cco.caltech.edu> <3A99AED0.5DF07890@infopuls.com> <97cd06$hcn$1@pyrite.mv.net> <97egck$vc6$3@info.cs.uofs.edu> <3A9AEFCD.AFC8431@infopuls.com> <97etsu$j41$1@pyrite.mv.net> <3A9B023A.CBD414A5@infopuls.com> <97hvro$hj4@freepress.concentric.net> Organization: LJK Software Date: 28 Feb 2001 13:11:16 -0500 NNTP-Posting-Host: 216.44.122.34 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 983383879 216.44.122.34 (Wed, 28 Feb 2001 18:11:19 GMT) NNTP-Posting-Date: Wed, 28 Feb 2001 18:11:19 GMT Xref: supernews.google.com comp.os.vms:20558 comp.sys.dec:2926 In article , rdeininger@mindspring.com (Robert Deininger) writes: > And if you need a nested if-else in both the if part and the else part, a > switch isn't simple anymore. But something like: if WINE = RED then if MOON = FULL then ACTION_1; else ACTION_2; end if; elsif SIZE > 500 then if SEASON = SPRING then ACTION_3; else ACTION_4; end if; else if OS = VMS then ACTION_5; else ACTION_6; end if; end if; Can be deconstructed into: if WINE = RED and MOON = FULL then ACTION_1; elsif WINE = RED then ACTION_2; elsif SIZE > 500 and SEASON = SPRING then ACTION_3; elsif SIZE > 500 then ACTION_4; elsif OS = VMS ACTION_5; else ACTION_6; end if; Remember that at this level it is the job of the compiler and not the programmer to perform optimization. The two examples above are quite likely to produce the same machine code (presuming I made no error in deconstruction).