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,571930b4ff0bc1ee X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-30 07:07:07 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!171.64.14.106!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison Sender: usenet@www.newsranger.com References: <3AC03CCE.70E3C2D5@mida.se> Subject: Re: Compile time executed functions Message-ID: Date: Fri, 30 Mar 2001 15:02:16 GMT NNTP-Posting-Host: 209.208.22.130 X-Complaints-To: abuse@newsranger.com X-Trace: www.newsranger.com 985964536 209.208.22.130 (Fri, 30 Mar 2001 10:02:16 EST) NNTP-Posting-Date: Fri, 30 Mar 2001 10:02:16 EST Organization: http://www.newsranger.com Xref: supernews.google.com comp.lang.ada:6248 Date: 2001-03-30T15:02:16+00:00 List-Id: In article , Robert A Duff says... > >But if you give me a language like that, and what I really want is a >while loop, I'll end up writing something like: > > for I in 1..10**100 loop -- or maybe just 2**31-1 ;-) > exit when ...; > ... > end loop; > >It's easy to prove that the above loop is not infinite, but if I make a >mistake in the exit condition, I'll end up with a very long loop, which >is just as bad in practise. True. I'd think most developers would rather make some attempt to put a reasonable limit on the for loop (eg: the maximum possible nodes in a list, or something), rather than an arbitrary one. But I often deal code that "most developers" would be loathe to write, so I know you have to deal with that case. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com