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,25aa3c7e1b59f7b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-04 06:28:14 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!feed2.onemain.com!feed1.onemain.com!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: A case where Ada defaults to unsafe? Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Fri, 4 Jan 2002 14:27:30 GMT References: <3C34BF2C.6030500@mail.com> <3C34D252.4070307@mail.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:18519 Date: 2002-01-04T14:27:30+00:00 List-Id: Hyman Rosen writes: > But get away from C/C++ for a moment. In pure Ada terms, isn't it less safe > for the defaults to be "and" and "or" instead of "and then" and "or else"? I think an expression where the right-hand side is meaningful only if the left-hand side is True is "special" and should be marked as such ("and then"). A more usual expression, where the two halves of "and" are symmetric, doesn't deserve the "extra" notation. I guess I'm arguing from a readability point of view, rather than safety per se. But readability promotes safety in general. Some people *always* use "and then", perhaps on the theory that it's more efficient. I don't like that style. If you're looking for cases where Ada makes the default less safe, I can think of a few. Here's one: "X: T := ...;" is a variable, whereas "X: constant T := ...;" is a constant. IMHO, it should be the other way around ("X: var T := ...;" for a variable), since constants are safer than variables. - Bob