comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Selecting Components
Date: Sun, 08 Jan 2006 20:35:48 GMT
Date: 2006-01-08T20:35:48+00:00	[thread overview]
Message-ID: <ln3bjyihjv.fsf@nuthaus.mib.org> (raw)
In-Reply-To: BFE616B5.1E9D0%yaldnif.b@blueyonder.co.uk

"(see below)" <yaldnif.b@blueyonder.co.uk> writes:
> On 7/1/06 20:24, in article
> UrVvf.339$Hd4.149@newsread1.news.pas.earthlink.net, "Jeffrey R. Carter"
> <spam@spam.com> wrote:
>
>> What would be the consequences if a language were designed so that all
>> selections used dot notation, including arrays:
>> 
>> Array.Index
>> Array.Index_1, Index_2
>> Array.Low .. High
>
> The consequence would be ambiguous arithmetic expressions.
>
> Consider:
>
> Array.Index + 1
>
> is this (Array.Index)+1 or Array.(Index+1)?

Presumably it would be (Array.Index) + 1; there's no reason for "."
to have a different precedence for arrays than for records.

There's a visual ambiguity: does Foo.Bar mean the Bar'th element of
the array Foo, or the component Bar of the record Foo?  This is of
course resolved by the type of Foo (unless Foo is an overloaded
function), but what's easy for the compiler may be difficult for a
human reader.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.



  parent reply	other threads:[~2006-01-08 20:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-07 20:24 Selecting Components Jeffrey R. Carter
2006-01-08  1:09 ` (see below)
2006-01-08  6:18   ` Jeffrey R. Carter
2006-01-08 20:35   ` Keith Thompson [this message]
2006-01-08 10:58 ` Dmitry A. Kazakov
2006-01-09  0:12 ` Georg Bauhaus
2006-01-09  4:41   ` Jeffrey R. Carter
2006-01-11  2:29 ` Stephen Leake
2006-01-11  3:01   ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox