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-Thread: 103376,2cb1f0b6d642e1dc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!newsfeed3.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Pascal Calling Convention Date: Tue, 29 Mar 2011 14:30:59 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <9b04626e-567d-408c-aab3-39b964b3ffd6@l2g2000prg.googlegroups.com> <4d90efdd$1$14806$882e7ee2@usenet-news.net> <330393be-cb82-4cd8-ba44-6e59af7b75bf@v11g2000prb.googlegroups.com> <4d90fd41$1$14782$882e7ee2@usenet-news.net> <4d9148d2$1$14782$882e7ee2@usenet-news.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1301423459 7064 192.74.137.71 (29 Mar 2011 18:30:59 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 29 Mar 2011 18:30:59 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:0l18BAUHPHn4+pP33cSm/zuTt1g= Xref: g2news1.google.com comp.lang.ada:18580 Date: 2011-03-29T14:30:59-04:00 List-Id: Hyman Rosen writes: > And it's a good program to keep at hand to serve as a counterexample > when programming languages want access to uninitialized data to be > undefined behavior. It's more sensible to regard such data as having > arbitrary but fixed values, subject to a validity check. Just because you know of one algorithm that could use that semantics?! (OK, I know of one other case. Sort of.) If I wanted to add this "feature" to Ada, I'd do so via an attribute: T'Arbitrary_Value returns an arbitrary value of type T. Then: My_Array := (1..1_000_000 => Integer'Arbitrary_Value); can be implemented in zero machine instructions. You really don't want to use arbitrary values by accident. At least with "undefined behavior", or "erroneous execution" the compiler can have a mode that detects uninit vars at run time, which can be useful for debugging. GNAT has a mode that detects most uninit vars at run time (although using uninit is no longer erroneous in Ada). - Bob