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 Path: g2news2.google.com!postnews.google.com!b22g2000prb.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Pascal Calling Convention Date: Tue, 29 Mar 2011 16:25:05 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9d1b632e-8185-40b6-b1e3-4781cb8bbe60@b22g2000prb.googlegroups.com> 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: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1301441106 5537 127.0.0.1 (29 Mar 2011 23:25:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 29 Mar 2011 23:25:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b22g2000prb.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:19559 Date: 2011-03-29T16:25:05-07:00 List-Id: On Mar 29, 11:30=A0am, Robert A Duff wrote: > 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. =A0Sort 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. =A0Then: > > =A0 =A0 My_Array :=3D (1..1_000_000 =3D> Integer'Arbitrary_Value); > > can be implemented in zero machine instructions. =A0You really don't want > to use arbitrary values by accident. If that feature were added, I'd want the language to specify that the value of the attribute must be a valid value for the subtype. (Maybe that's what you meant and didn't say so explicitly?) That would still be a no-op if every bit pattern would be a valid value, which would be the case for Integer (or for the first subtype of a "mod 2**32" or "mod 2**64" type on most machines, which I think would be needed to make Hyman's example work). -- Adam