comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@cs.rmit.edu.au>
Subject: Re: Why not using [] instead of () for array?
Date: Mon, 25 Feb 2002 14:23:29 +1100
Date: 2002-02-25T14:23:29+11:00	[thread overview]
Message-ID: <dale-B26DE0.14232825022002@its-aw-news.its.rmit.edu.au> (raw)
In-Reply-To: 9ff447f2.0202241719.446bf17b@posting.google.com

Adrian Hoe wrote:

> "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.


I've done a bit of Ada programming, and never really found it to be
a problem. Generally array accessing is fairly local in scope, and
you can see/know where the array declaration is.

For larger programs you tend to hide arrays behind functions/procedures
(you can pragma inline them if needs be).

In the end it's not going to lead to errors because any ambiguity 
will be picked up and flagged by the compiler.

The only real reason for () vs [] in Ada is historical.


Dale



  parent reply	other threads:[~2002-02-25  3:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-25  1:19 Why not using [] instead of () for array? 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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2002-02-28  6:37 Christoph Grein
2002-02-28 22:56 ` Jeffrey 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