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,803df5f3f60558d5 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Uninitialized "out" parameters Date: 1996/07/25 Message-ID: #1/1 X-Deja-AN: 170825181 references: <31EEACDA.64880EEB@sage.inel.gov> <4t1s3n$chv@goanna.cs.rmit.edu.au> <4t7amf$701@goanna.cs.rmit.edu.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-25T00:00:00+00:00 List-Id: In article <4t7amf$701@goanna.cs.rmit.edu.au>, Richard A. O'Keefe wrote: > 'procedure' foo(N, A); > 'value' N; 'integer' A; > 'array' A; > 'begin' > 'if' N = 1 'then' A[1] := 0.0 'else' A[1,2] := 0.0; > 'end'; >with the type check done dynamically. In Ada, this is no longer allowed, >and you don't say "the Ada type check cannot be completely statically >reliable", you say "programs that don't make it through the Ada type >system are *usually* wrong, so we think it's a good tradeoff that some >programs are rejected even though no "type" error would have occurred >at run time." Well, that's true to a great extent, but the Ada 83 designers also said "for cases where flexibility is more important, we'll give them variant records", and the Ada 95 designers said, "for those cases, we'll give them class-wide types". Both features (variant records and class-wide types) involve some amount of run-time checking. In fact one major advantage of class-wide types is that more cases can be checked at compile time, but it's never a case of "everything is checked at compile time, and all run-time checks are evil". >...In both cases, whether it is state or type we are talking about, >the compiler checks what it can, and there is something left over to be >checked at run time. >From that statement, it sound to me like everybody's in agreement. >There are a lot of old solutions, too. If you insist "but you MUST be >able to handle arrays exactly the way they are now or I'll say Nyah-nyah", >then you'll be saying nyah'nyah until the last proton decays. True. We're talking about language design in an Ada newsgroup, and some people are thinking "what (if anything) would be reasonable to add to Ada without changing the entire type model and everything else", and others are thinking "what is a good way to do this, assuming we are allowed to design the entire language from scratch". These are two different questions! (I enjoy thinking about both.) - Bob