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: border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bill Findlay Newsgroups: comp.lang.ada Subject: Re: Dereferencing and style guides Date: Fri, 11 Oct 2013 09:07:26 +0100 Message-ID: References: <5249ab97$0$6625$9b4e6d93@newsspool2.arcor-online.net> <23baa71a-6293-452c-89de-16052a198d20@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net TmmDQHYUOWnHITsCV1Ed+Q6XtgqvmvuUJY2mUWIb8UeGKq8wtU Cancel-Lock: sha1:A9waGavLoteeQlypjUyljOLXWW8= User-Agent: Microsoft-Entourage/12.36.0.130206 Thread-Topic: Dereferencing and style guides Thread-Index: Ac7GWOwMkNQVqtzgpk67NTzl4kS+Cg== Xref: number.nntp.dca.giganews.com comp.lang.ada:183609 Date: 2013-10-11T09:07:26+01:00 List-Id: On 10/10/2013 23:49, in article wcchaco3fne.fsf@shell01.TheWorld.com, "Robert A Duff" wrote: > Adam Beneschan writes: > >> I can imagine that Ada might have adopted the same syntax, if only >> those old keypunch machines had a ^ character on them. > > I thought they did. Except it looked like an up-arrow. > > Anyway, the solution to keyboards with missing characters > is clear: see J.2. 7-bit ASCII was standard at the time. > >> On the other hand, I'm not sure about the idea that "making things >> just one character" equates to readability. If that were true, APL >> would be the most readable language around. And C would be second. > > Well, I didn't say everything should be one character. I said > the dereference operator should be one character. So I'd say > APL is a bit of a straw man here. I'm quite happy to say > "end if;" where C says "}". > > In Ada, dereference is usually zero characters, so I'm actually arguing > for MORE verbosity! Just a little more. Can I make the contrary case? Given that we know that P is a pointer, P.f or P(i) can only reasonably be interpreted as dereferencing P and selecting a component from the result; so I do not see that P^.f or P^(i) improves comprehensibility to any significant degree. Given that we do not know that P is a pointer, P.f or P(i) is essentially the same cognitive burden as R.f or A(i); from the uniform referent point of view this is an advantage. It fails to be, only if the dereference fails, and we know that that should not happen in Ada 8-). Even if it does, the extra effort of perceiving the semantics correctly is trivial. -- Bill Findlay with blueyonder.co.uk; use surname & forename;