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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Introductory Ada Programming Book Date: Wed, 04 Jan 2017 15:15:13 +0000 Organization: A noiseless patient Spider Message-ID: References: <87r34j39u6.fsf@nightsong.com> <7643d59e-061f-42df-adda-9322608f127b@googlegroups.com> <75f2482a-a94b-4820-b2b1-990010103709@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="abd8a16d3b0bc13740f3e1f6eb6a6441"; logging-data="19917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QqmlninzuPkro6+mAUv1lmdSVGdVe4vQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) Cancel-Lock: sha1:lzyaaPR8xmxeNnVd8XQUg/JHiDg= sha1:Ca7aN+qPLuh/FT3VHQnpOAghyPs= Xref: news.eternal-september.org comp.lang.ada:33046 Date: 2017-01-04T15:15:13+00:00 List-Id: "Dmitry A. Kazakov" writes: > On 2017-01-04 14:45, raph.amiard@gmail.com wrote: > >> Or do it Swift's way and use flow analysis to make use of an >> uninitialized variable a compile time error. > > That is a bad idea. If uninitialized variable is an error then that > must make the program illegal. If the program is still legal, then it > is not an error. Swift's way appears to be that *using* an uninitialized variable is an error (provided that the compiler can detect it, of course). GNAT has warnings about possible UBI, I think. And SPARK makes it an error.