comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Why is it Called a Package?
Date: 2000/04/07
Date: 2000-04-07T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.0004071240470.28379-100000@shell5.ba.best.com> (raw)
In-Reply-To: 38EE19E0.F0232DB0@Raytheon.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 2551 bytes --]

On Fri, 7 Apr 2000, Samuel T. Harris wrote:
> Pascal Obry wrote:
> > Brian Rogoff <bpr@shell5.ba.best.com> a écrit dans le message :
> > Pine.BSF.4.21.0004061305320.6588-100000@shell5.ba.best.com...
> > > I think if the syntax were to be redone I'd like the issue of "()" versus
> > > "[]" for array indexing to be reexamined. Then we could also think about
> > > some syntactic sugar for overloading "[]" as in C++. The restrictions on
> > > the character set that were part of the original Ada requirements don't
> > > make a lot of sense to me now, though the restriction to ASCII is OK.
> > 
> > I don't think we want that. A very nice consequence here is that you can
> > easily change an abstraction from:
> > 
> >    package P is
> >       Some_Value : array (1 .. 10) of Integer;
> >       --  first quick implementation using basic array
> >    end P;
> > 
> > to
> > 
> >    package P is
> >       function Some_Value (N : in Positive) return Integer;
> >       --  real implementation using a complex structure
> >    end P;
> > 
> > (or the other way around) without modifying all client code.

I didn't see Pascal's original message, but this is the original reason
given for this choice. I've never had to do this, and I don't find this 
reason compelling. It sure seems easy enough to wrap everything with
function calls if you want to enforce a uniform syntax in the client code.

> > I really don't see what would be gained by using "[]"... a more
> > C/C++ syntax :)

Readability suffers from using the () for both IMO. As I said though, this 
is not a discussion about a change to Ada but about a *new* Ada like
language. 

I think its unfortunate that anything connected with C or C++ causes such 
a reaction in Ada fans. Consider that for most programmers Ada elicits a
similar knee-jerk response. Remember, all programming languages suck :-)

> I'd rather see [] and {} be allowed as substitutions for ()
> in a similar way that ! of allowed for |, % is allowed for ",
> and : is allowed for #. Of course, just as %'s substituded for "
> have to be paired, so would {} and [] substitutions.

I don't like this idea. This would cause too many divergences in styles 
in the Ada community. 

> I see no compelling reason why array indexing
> must be syntactically different from function calls. 

Because they are different. 

"Some believe that we lacked the programming language to describe your 
 perfect world" 

 Agent Smith - The Matrix (1999)

-- Brian






  parent reply	other threads:[~2000-04-07  0:00 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-27  0:00 Why is it Called a Package? Gary Scott
2000-03-27  0:00 ` Nick Roberts
2000-03-27  0:00   ` Robert A Duff
2000-03-29  0:00     ` Florian Weimer
2000-03-29  0:00       ` Robert A Duff
2000-03-30  0:00         ` Geoff Bull
2000-03-30  0:00           ` Robert A Duff
2000-03-30  0:00             ` Jean-Marc Bourguet
2000-03-30  0:00               ` David Starner
2000-04-03  0:00               ` Robert A Duff
2000-04-06  0:00             ` Brian Rogoff
2000-04-07  0:00               ` Pascal Obry
2000-04-07  0:00                 ` Paul Graham
2000-04-07  0:00                 ` Samuel T. Harris
2000-04-07  0:00                   ` Richard D Riehle
2000-04-08  0:00                     ` Florian Weimer
2000-04-09  0:00                       ` Stefan Skoglund
2000-04-07  0:00                   ` Brian Rogoff [this message]
2000-04-08  0:00                     ` Robert A Duff
2000-04-07  0:00                   ` Stanley R. Allen
2000-04-07  0:00               ` Robert Dewar
2000-04-07  0:00                 ` Brian Rogoff
2000-04-07  0:00                   ` Hyman Rosen
2000-04-07  0:00                     ` Brian Rogoff
2000-04-12  0:00                 ` Comment from the trenchs Robert Brantley
2000-04-13  0:00                   ` Jeff Carter
2000-04-17  0:00                     ` Robert Brantley
2000-04-07  0:00               ` Why is it Called a Package? Robert A Duff
2000-04-07  0:00                 ` Brian Rogoff
2000-04-07  0:00                   ` Robert A Duff
2000-04-08  0:00                     ` Brian Rogoff
2000-03-28  0:00   ` Jean-Marc Bourguet
2000-03-28  0:00     ` Robert A Duff
2000-03-30  0:00     ` Alfred Hilscher
2000-03-31  0:00       ` Anders Wirzenius
2000-03-28  0:00   ` Ken Garlington
2000-03-29  0:00   ` Florian Weimer
2000-03-27  0:00 ` Larry Kilgallen
2000-03-27  0:00   ` Robert A Duff
2000-03-28  0:00     ` Gary Scott
2000-03-27  0:00 ` Ted Dennison
replies disabled

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