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!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: How to make Ada popular. Get rid of ";" at end of statement. Date: Fri, 26 Jul 2019 21:06:05 -0700 Organization: None to speak of Message-ID: References: <5d9a8728-3c5b-4caf-b765-a455ba4d3523@googlegroups.com> <5fb45b9c-d7da-447c-999e-0e8bcce2eed5@googlegroups.com> <1dc13d50-7606-4530-b5cc-19e07b4d4938@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="d8a2633722fb5b0a068c2be01b0d1b9e"; logging-data="32278"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nmq7y1EbxfkPSF+NvqZ5a" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:sH6qjw7yYD4YMQ8+qz3Dvfcd4Ts= sha1:NrA6rx3ZK+BI3T3Rn+tRfO9PHT4= Xref: reader01.eternal-september.org comp.lang.ada:56970 Date: 2019-07-26T21:06:05-07:00 List-Id: "Randy Brukardt" writes: > "Keith Thompson" wrote in message > news:lnh8785kge.fsf@kst-u.example.com... >> Lucretia writes: >>> On Thursday, 25 July 2019 08:26:29 UTC+1, Maciej Sobczak wrote: >>>> > The one concrete reason I've ever heard for using C or C++ instead >>>> > of Modula-2 or Ada is that C/C++ allow you to perform pointer >>>> > arithmetic >>>> >>>> Really? I would never consider that reason myself. >>> >>> Me neither, but then you can do pointer arithmetic in Ada, you just >>> use normal numbers and convert to an address. >> >> I'm fairly sure there's no guarantee that the result of any such >> conversion (which would have to use Unchecked_Conversion or something >> equivalent, unless I've missed something) would be meaningful. > > And there is in C?? ;-) No. Did I imply that there is? But C pointer arithmetic (without conversion to and from an integer type) is well defined as long as you stay within a single (array) object. This isn't comp.lang.c, so I won't go into the details. > Package System.Storage_Elements includes operations for directly doing > address arithmetic - you would have to do the multiplies on values of > Storage_Offset (which is an integer type) and then add/subtract those from > values of System.Address. So it does. The standard doesn't seem to say much about what operations are well defined beyond suggesting that they "should reflect the target environment semantics as closely as is reasonable". (C *needs* to go into a lot more detail about pointer arithmetic because so much of the language depends on it.) [snip] To be clear, I'm not making any arguments for or against C or Ada. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */