comp.lang.ada
 help / color / mirror / Atom feed
* Re: Why not using [] instead of () for array?
@ 2002-02-28  6:37 Christoph Grein
  2002-02-28 22:56 ` Jeffrey Carter
  0 siblings, 1 reply; 21+ messages in thread
From: Christoph Grein @ 2002-02-28  6:37 UTC (permalink / raw)


From: Jeffrey Carter <jeffrey.carter@boeing.com>
> ... Robert Dewar
> (whoever he is) ...

Is this a joke? You do not know Robert??? Everyone knows Robert for his famous: 
"This is obvious, I do not see how you could think otherwise..." :-)



^ permalink raw reply	[flat|nested] 21+ messages in thread
* Why not using [] instead of () for array?
@ 2002-02-25  1:19 Adrian Hoe
  2002-02-25  1:48 ` Larry Kilgallen
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Adrian Hoe @ 2002-02-25  1:19 UTC (permalink / raw)


I had a possibly fruitful discussion (a long one and solely discussed
about using Ada for joint-project) with a number of possible
co-workers this weekend. When I showed them a piece of Ada source
code, one (only) question was asked by these friends and I didn't know
exactly the answer.

"Why not use [] instead of () for array in Ada?"

Two reasons for [] is preferred to ():

1. More clarity, certainly leads to more readability.

2. More distinguishable from functions parameters and leads to 1.


Example 1
=========
matrix (1 .. 100);

compares to

matrix [1 .. 100];


Example 2
=========

do_matrix (8);

a := matrix (8);

compares to

do_matrix (8);

a:= matrix [8];

where do_matrix is a procedure (or can be function) which takes an
integer parameter to refer an array. Notice the use of matrix [8]
instantly distingusihes itself from a function/procedure with
parameter(s) compares to matrix (8).

I don't know if this has been discussed before. But I think this is a
good question. What exactly the reason for using () rather than []? I
strongly believe a strong reason exists which I don't know. Anyone?

                              -- Adrian Hoe
                              -- http://greenlime.com/users/adrian.hoe



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2002-02-28 22:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-28  6:37 Why not using [] instead of () for array? Christoph Grein
2002-02-28 22:56 ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
2002-02-25  1:19 Adrian Hoe
2002-02-25  1:48 ` Larry Kilgallen
2002-02-25  3:14   ` Darren New
2002-02-25 10:14   ` Peter Hermann
2002-02-25  3:23 ` Dale Stanbrough
2002-02-25  5:28 ` David Starner
2002-02-25 14:39   ` Robert Dewar
2002-02-26  7:56     ` Mats Karlssohn
2002-02-27  4:52       ` Robert Dewar
2002-02-27 16:44         ` Darren New
2002-02-27 14:29       ` David Starner
2002-02-27  0:50     ` Adrian Hoe
2002-02-27 17:37       ` Jeffrey Carter
2002-02-25 18:46 ` Toshitaka Kumano
2002-02-27  4:54   ` Robert Dewar
2002-02-27  8:48     ` Dmitry A. Kazakov
2002-02-28  5:29       ` Adrian Hoe
2002-02-28 21:39       ` Florian Weimer
2002-02-27  1:09 ` Adrian Hoe

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