comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Subscript brackets
Date: 1996/05/02
Date: 1996-05-02T00:00:00+00:00	[thread overview]
Message-ID: <DqsEIA.5sC@world.std.com> (raw)
In-Reply-To: 4m515d$pok@calypso.bns.com.au


In article <4m515d$pok@calypso.bns.com.au>,
Michael Talbot-Wilson <mike@calypso.bns.com.au> wrote:
>Are there any plans to convert from parentheses to square brackets
>for array subscripts in Ada?

No way.

I like square brackets for array indexing, too.  I understand the
uniform-reference argument that Roberts Eachus and Dewar gave, but I
don't buy it.  The semantics of arrays and functions are different
enough, in my opinion, that using the same notation is a confusion,
IMHO.  And, when combined with the fact that parameterless function
calls don't have parens, it adds a big chunk of complexity to Ada
compilers, for little benefit.

Historically, I believe the uniform-reference argument was *part* of the
original reason for not using square brackets.  Another part was that
the early requirements documents for Ada stated that the character set
used had to be restricted, so that it could be used on things like
teletype machines.

I also think that square brackets, or *some* other notation, should have
been used for aggregates.  This would solve the problem that you can't
write a positional array aggregate with one element, in Ada, because it
would be confused with a parenthesized expression.  You also can't write
a zero-element positional array aggregate, which is another design flaw.

>Maybe this is a minor point, ...

Yes, it's a minor point, which is why it's not likely to change.

>A preprocessor which converted just these parentheses to brackets
>and left non-array-subscript parentheses alone would allow
>existing source to be compiled.  And (I guess) remove the ambiguities
>of parsing this feature from the compiler, allowing its cost to
>be more clearly seen.

I'm not sure what you mean, here.  The preprocessor reads standard Ada,
and outputs square brackets instead?  Such a preprocessor needs to do
overload resolution, which makes it approximately as complex as the
front end of an Ada compiler.  Seems like a lot of trouble for a "minor
point".

>It there any intention of doing this?  Is there any suggested date
>when it might happen?  I think some people who would like to convert
>to or start working in Ada would like a date to aim at, supposing it
>is ever going to happen.

I doubt if a lot of people who would like to use Ada are holding off
because of this minor syntactic point.

- Bob




  parent reply	other threads:[~1996-05-02  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-30  0:00 Subscript brackets Michael Talbot-Wilson
1996-05-01  0:00 ` Robert I. Eachus
1996-05-02  0:00 ` Robert Dewar
1996-05-03  0:00   ` Tarjei Jensen
1996-05-02  0:00 ` Robert A Duff [this message]
1996-05-02  0:00   ` Robert Dewar
replies disabled

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