comp.lang.ada
 help / color / mirror / Atom feed
* Why is it Called a Package?
@ 2000-03-27  0:00 Gary Scott
  2000-03-27  0:00 ` Larry Kilgallen
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Gary Scott @ 2000-03-27  0:00 UTC (permalink / raw)


Admittedly a "fluff" question...

I notice that a lot of modern languages choose names/syntax that I
personally do not find intuitive.  Other languages contain basically the
same feature but call it by different names (module, etc.).  Why was
"package" considered the intuitive name for this feature?




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

* Re: Why is it Called a Package?
  2000-03-27  0:00 Why is it Called a Package? Gary Scott
@ 2000-03-27  0:00 ` Larry Kilgallen
  2000-03-27  0:00   ` Robert A Duff
  2000-03-27  0:00 ` Nick Roberts
  2000-03-27  0:00 ` Ted Dennison
  2 siblings, 1 reply; 41+ messages in thread
From: Larry Kilgallen @ 2000-03-27  0:00 UTC (permalink / raw)


In article <38DF7F38.8D656ABD@lmtas.lmco.com>, Gary Scott <Gary.L.Scott@lmtas.lmco.com> writes:
> Admittedly a "fluff" question...
> 
> I notice that a lot of modern languages choose names/syntax that I
> personally do not find intuitive.  Other languages contain basically the
> same feature but call it by different names (module, etc.).  Why was
> "package" considered the intuitive name for this feature?

I was not there when the decision was made, but I would presume the
goal was to _avoid_ using a familiar name since other languages do
not typically have something that behaves in this fashion.  If one
were to propose the term "module", for instance, those who knew
other programming languages and were learning Ada might presume
that it worked like a "module" in those other languages, and they
would be wrong.

I program in several languages that have "modules" and those "modules"
do not support separately compiled specifications and bodies, cannot
be nested within other "modules", etc.




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

* Re: Why is it Called a Package?
  2000-03-27  0:00 Why is it Called a Package? Gary Scott
  2000-03-27  0:00 ` Larry Kilgallen
@ 2000-03-27  0:00 ` Nick Roberts
  2000-03-27  0:00   ` Robert A Duff
                     ` (3 more replies)
  2000-03-27  0:00 ` Ted Dennison
  2 siblings, 4 replies; 41+ messages in thread
From: Nick Roberts @ 2000-03-27  0:00 UTC (permalink / raw)


Gary Scott wrote:
> 
> Admittedly a "fluff" question...
> 
> I notice that a lot of modern languages choose names/syntax that I
> personally do not find intuitive.  Other languages contain basically the
> same feature but call it by different names (module, etc.).  Why was
> "package" considered the intuitive name for this feature?

One answer might be: because a word had to be chosen. Now (if you really
want to ruffle some feathers ;-) ask why 'all' was chosen as the word to
signify dereferencing (hardly intuitive), why 'others' was chosen as the
the word to signify a default value for choices (not very intuitive
when, as is quite commonly done, it is the only choice), or why, for
that matter, any language uses the words and/or terms 'loop' and
'iteration', when the words 'repeat' and 'repetition' would be easier
and more obvious (and 'do' must be the least intuitive of all).

Of course, for all those poor souls whose native language is not
English, but who must program (Ada and other languages) in English,
perhaps you'd better not ask about words being 'intuitive' after all.
Imagine it! Ouch. They have my sympathy.

-- 
Nick Roberts
http://www.adapower.com/lab/adaos




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

* Re: Why is it Called a Package?
  2000-03-27  0:00 ` Larry Kilgallen
@ 2000-03-27  0:00   ` Robert A Duff
  2000-03-28  0:00     ` Gary Scott
  0 siblings, 1 reply; 41+ messages in thread
From: Robert A Duff @ 2000-03-27  0:00 UTC (permalink / raw)


kilgallen@eisner.decus.org (Larry Kilgallen) writes:

> In article <38DF7F38.8D656ABD@lmtas.lmco.com>, Gary Scott <Gary.L.Scott@lmtas.lmco.com> writes:
> > Admittedly a "fluff" question...
> > 
> > I notice that a lot of modern languages choose names/syntax that I
> > personally do not find intuitive.  Other languages contain basically the
> > same feature but call it by different names (module, etc.).  Why was
> > "package" considered the intuitive name for this feature?

Well, a package in real life is a thing that contains a collection of
other things, all wrapped up together, which is sort of like what an Ada
package is.

Anyway, programming language design is too immature to have a standard
terminology.  You can't blame Ada for choosing "package" any more than
you can blame some other language for using "module" or "cluster".
They're all pretty reasonable names, IMHO.

> I was not there when the decision was made, but I would presume the
> goal was to _avoid_ using a familiar name since other languages do
> not typically have something that behaves in this fashion.  If one
> were to propose the term "module", for instance, those who knew
> other programming languages and were learning Ada might presume
> that it worked like a "module" in those other languages, and they
> would be wrong.
> 
> I program in several languages that have "modules" and those "modules"
> do not support separately compiled specifications and bodies, cannot
> be nested within other "modules", etc.

I wasn't there either, but I doubt if that was the goal, and I don't
think it *should* be the goal.  First of all, Ada's packages are pretty
much like Modula-2 modules (which by the way *can* be nested and *can*
have separate spec/body).  Even in languages that don't allow those
things, the concept is close enough that it would not be confusing to
have the same name.

Ada's procedures don't work exactly like Pascal's procedures, either.
For example parameter passing is completely different.  But the two
things serve the same basic purpose, so it makes sense to call them by
the same name.  Too bad other languages call them "functions" or "void
functions" or "methods" or "subroutines".

By the way, I'm told (by Robert Dewar, I think) that it *was* a goal of
Ada 83 to avoid the term "pointer" -- hence the term "access type", to
distinguish between Ada's pointers (relatively type safe) and the kinds
of pointers found in (eg) C.  I don't like that idea -- Ada's pointers,
although different from C's, serve something of the same purpose --
enough to call them by the same name.  Anyway, Ada is based on Pascal,
not C, and Pascal's pointers are just like Ada-83's.  Calling them
"accesses" serves only to confuse newcomers.

- Bob




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

* Re: Why is it Called a Package?
  2000-03-27  0:00 Why is it Called a Package? Gary Scott
  2000-03-27  0:00 ` Larry Kilgallen
  2000-03-27  0:00 ` Nick Roberts
@ 2000-03-27  0:00 ` Ted Dennison
  2 siblings, 0 replies; 41+ messages in thread
From: Ted Dennison @ 2000-03-27  0:00 UTC (permalink / raw)


In article <38DF7F38.8D656ABD@lmtas.lmco.com>,
Gary Scott <Gary.L.Scott@lmtas.lmco.com> wrote:
> Admittedly a "fluff" question...
>
> I notice that a lot of modern languages choose names/syntax that I
> personally do not find intuitive. Other languages contain basically
> the same feature but call it by different names (module, etc.). Why
> was "package" considered the intuitive name for this feature?

As you say, fluff. But I looked for information in the Ada83 Rationale
on this topic. I couldn't find an explanation for the name. But I did
find a lot of talk about "modularity" and "modularization", and no talk
about "packaging".


--
T.E.D.
http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Why is it Called a Package?
  2000-03-27  0:00 ` Nick Roberts
@ 2000-03-27  0:00   ` Robert A Duff
  2000-03-29  0:00     ` Florian Weimer
  2000-03-28  0:00   ` Ken Garlington
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 41+ messages in thread
From: Robert A Duff @ 2000-03-27  0:00 UTC (permalink / raw)


Nick Roberts <nickroberts@callnetuk.com> writes:

> One answer might be: because a word had to be chosen. Now (if you really
> want to ruffle some feathers ;-)

I'm not sure why this stuff should ruffle feathers,
but you might be right.  ;-)  Certainly trivial issues
cause the most discussion, perhaps because everybody can understand
the issues.

>... ask why 'all' was chosen as the word to
> signify dereferencing (hardly intuitive), why 'others' was chosen as the
> the word to signify a default value for choices (not very intuitive
> when, as is quite commonly done, it is the only choice), or why, for
> that matter, any language uses the words and/or terms 'loop' and
> 'iteration', when the words 'repeat' and 'repetition' would be easier
> and more obvious (and 'do' must be the least intuitive of all).

FWIW, I don't like ".all" -- I prefer Pascal's "^".  If it weren't such
a big ugly thing, it wouldn't need to be optional -- I like being
explicit about pointer dereferencing, because it has important
semantics, but I never write ".all" except in the few cases where it's
required, and then grudgingly.  "Others" seems fine to me, although I
must admit that when I first learned Ada in 1980 or so, I was confused
by the others-only case -- I remember asking an expert if something like
"(others => 'x')" was legal.  I prefer Pascal's "while ... do" to Ada's
"while ... loop", although I wouldn't like "do ... end do;".  I would
prefer "while ... do ... end while;" and "loop ... end loop;".  Also
"for ... do ... end for;".  Pascal has "repeat ... until".

> Of course, for all those poor souls whose native language is not
> English, but who must program (Ada and other languages) in English,

... such as Jean Ichbiah himself!  ;-) ...

> perhaps you'd better not ask about words being 'intuitive' after all.
> Imagine it! Ouch. They have my sympathy.

Yes, I imagine that's painful.  There was a discussion on comp.lang.misc
a couple of months ago, where somebody was trying to design a language
that had no keywords -- the point being to avoid the problem of
non-English speakers being confused by English words.  Even the playing
field.  Everything was done with squiggly-looking punctuation
characters.  To me, it looked like C, only less readable.  The language
designer was not a native English speaker (although his posts were in
English, and were perfectly understandable to me).

- Bob




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

* Re: Why is it Called a Package?
  2000-03-27  0:00 ` Nick Roberts
  2000-03-27  0:00   ` Robert A Duff
@ 2000-03-28  0:00   ` Ken Garlington
  2000-03-28  0:00   ` Jean-Marc Bourguet
  2000-03-29  0:00   ` Florian Weimer
  3 siblings, 0 replies; 41+ messages in thread
From: Ken Garlington @ 2000-03-28  0:00 UTC (permalink / raw)


Try using the dot (".") as the symbol that signifies logical dereferencing
(of access values, records, packages...) and see if "all" makes more sense.

"Nick Roberts" <nickroberts@callnetuk.com> wrote in message
news:38DFB0BC.9FF72EFC@callnetuk.com...
> Gary Scott wrote:
> >
> > Admittedly a "fluff" question...
> >
> > I notice that a lot of modern languages choose names/syntax that I
> > personally do not find intuitive.  Other languages contain basically the
> > same feature but call it by different names (module, etc.).  Why was
> > "package" considered the intuitive name for this feature?
>
> One answer might be: because a word had to be chosen. Now (if you really
> want to ruffle some feathers ;-) ask why 'all' was chosen as the word to
> signify dereferencing (hardly intuitive),
> --
> Nick Roberts
> http://www.adapower.com/lab/adaos






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

* Re: Why is it Called a Package?
  2000-03-27  0:00 ` Nick Roberts
  2000-03-27  0:00   ` Robert A Duff
  2000-03-28  0:00   ` Ken Garlington
@ 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-29  0:00   ` Florian Weimer
  3 siblings, 2 replies; 41+ messages in thread
From: Jean-Marc Bourguet @ 2000-03-28  0:00 UTC (permalink / raw)


In article <38DFB0BC.9FF72EFC@callnetuk.com>,
Nick Roberts <nickroberts@callnetuk.com> wrote:
> Of course, for all those poor souls whose native language is not
> English, but who must program (Ada and other languages) in English,
> perhaps you'd better not ask about words being 'intuitive' after all.
> Imagine it! Ouch. They have my sympathy.

I find quite easy to use programming languages in which keywords are not
in my mother language. As a matter of fact, it is perhaps easier, as
the technical meaning does not conflict with the every day use (I've
sometime problems when I find word I know the technical meaning in a
non technical context).

Note that my mother language is french, it is perhaps not the case for
those which speak languages less apparented with english.

-- Jean-Marc


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Why is it Called a Package?
  2000-03-28  0:00   ` Jean-Marc Bourguet
@ 2000-03-28  0:00     ` Robert A Duff
  2000-03-30  0:00     ` Alfred Hilscher
  1 sibling, 0 replies; 41+ messages in thread
From: Robert A Duff @ 2000-03-28  0:00 UTC (permalink / raw)


Jean-Marc Bourguet <bourguet@my-deja.com> writes:

> I find quite easy to use programming languages in which keywords are not
> in my mother language.

Apparently, you have no trouble using English to write newsgroup
postings, either.  :-)

>... As a matter of fact, it is perhaps easier, as
> the technical meaning does not conflict with the every day use (I've
> sometime problems when I find word I know the technical meaning in a
> non technical context).
> 
> Note that my mother language is french, it is perhaps not the case for
> those which speak languages less apparented with english.

- Bob




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

* Re: Why is it Called a Package?
  2000-03-27  0:00   ` Robert A Duff
@ 2000-03-28  0:00     ` Gary Scott
  0 siblings, 0 replies; 41+ messages in thread
From: Gary Scott @ 2000-03-28  0:00 UTC (permalink / raw)




Robert A Duff wrote:
> 
> Ada's procedures don't work exactly like Pascal's procedures, either.
> For example parameter passing is completely different.  But the two
> things serve the same basic purpose, so it makes sense to call them by
> the same name.  Too bad other languages call them "functions" or "void
> functions" or "methods" or "subroutines".

And some languages have "functions", "subroutines", AND "procedures"
with "procedure" being the method used to expose or hide global/local
variables and other environment stuff (i.e. procedure is a
sub-subroutine (void function) or a sub-function).


> 
> 
> - Bob




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

* Re: Why is it Called a Package?
  2000-03-29  0:00     ` Florian Weimer
@ 2000-03-29  0:00       ` Robert A Duff
  2000-03-30  0:00         ` Geoff Bull
  0 siblings, 1 reply; 41+ messages in thread
From: Robert A Duff @ 2000-03-29  0:00 UTC (permalink / raw)


Florian Weimer <fw@deneb.cygnus.argh.org> writes:

> 
> Robert A Duff <bobduff@world.std.com> writes:
> 
> > FWIW, I don't like ".all" -- I prefer Pascal's "^".
> 
> A missing or a surplus dereference operation can make a huge
> difference, and sometimes, both variants are legal Ada code.  So it's
> probably better to have a clear mark for this, and "^" is perhaps too
> easily overlooked.

But in Ada, dereferences are *optional* in most contexts!  And all
programmers leave them out when optional, because ".all" is so big and
ugly and non-intuitive.  My point was that I agree with you that
dereferences make a huge difference, and so should be explicit.
Mumble^.Next is plenty explicit for me.

>...  Personally, I prefer U+2191 (UPWARDS ARROW) to
> ".all", but the former would involve a quite radical change. ;)

Well, the "^" of Pascal originally *was* an up arrow.

- Bob




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

* Re: Why is it Called a Package?
  2000-03-27  0:00 ` Nick Roberts
                     ` (2 preceding siblings ...)
  2000-03-28  0:00   ` Jean-Marc Bourguet
@ 2000-03-29  0:00   ` Florian Weimer
  3 siblings, 0 replies; 41+ messages in thread
From: Florian Weimer @ 2000-03-29  0:00 UTC (permalink / raw)


Nick Roberts <nickroberts@callnetuk.com> writes:

> Of course, for all those poor souls whose native language is not
> English, but who must program (Ada and other languages) in English,

Ada is more liberal than other programming languages here because you
can use non-ASCII characters in identifiers.  (I wonder whether anyone
actually does this, though...)

BTW: Microsoft completely localized the version of Visual Basic for
Applications which was part of Excel 5.0, including the keywords and
the runtime library.  I have no idea why they did this as it makes
distributing code extremly painful.  Perhaps they got the idea from
spreadsheet formulas which are traditionally localized?  In the end,
they gradually reverted the localization (first, the keywords and the
runtime library were left unlocalized, and the Excel object library
finally followed, I think), but of course, this was causing quite a
lot of problems on its own.




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

* Re: Why is it Called a Package?
  2000-03-27  0:00   ` Robert A Duff
@ 2000-03-29  0:00     ` Florian Weimer
  2000-03-29  0:00       ` Robert A Duff
  0 siblings, 1 reply; 41+ messages in thread
From: Florian Weimer @ 2000-03-29  0:00 UTC (permalink / raw)


Robert A Duff <bobduff@world.std.com> writes:

> FWIW, I don't like ".all" -- I prefer Pascal's "^".

A missing or a surplus dereference operation can make a huge
difference, and sometimes, both variants are legal Ada code.  So it's
probably better to have a clear mark for this, and "^" is perhaps too
easily overlooked.  Personally, I prefer U+2191 (UPWARDS ARROW) to
".all", but the former would involve a quite radical change. ;)




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

* Re: Why is it Called a Package?
  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
  1 sibling, 1 reply; 41+ messages in thread
From: Alfred Hilscher @ 2000-03-30  0:00 UTC (permalink / raw)




Jean-Marc Bourguet wrote:
> I find quite easy to use programming languages in which keywords are not
> in my mother language. As a matter of fact, it is perhaps easier, as

I prefer english keywords, too.  If I imagine a program written for
example in german (my nativ language) it looks for me more to be a joke:

W�hrend I > 0 tue
  I := I - 1;
Ende w�hrend;


What is the opinion of people with a different character set, e.g.
Chinese, Arabian, Russian ?




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

* Re: Why is it Called a Package?
  2000-03-30  0:00         ` Geoff Bull
@ 2000-03-30  0:00           ` Robert A Duff
  2000-03-30  0:00             ` Jean-Marc Bourguet
  2000-04-06  0:00             ` Brian Rogoff
  0 siblings, 2 replies; 41+ messages in thread
From: Robert A Duff @ 2000-03-30  0:00 UTC (permalink / raw)


Geoff Bull <geoff@research.canon.com.au> writes:

> Isn't it a little bit late to be arguing about this?
[notation for ".all"]

Only if you think Ada 95 is the final word in programming language
design.  ;-)

Of course I don't think anybody's going to change the syntax of Ada at
this point.  But I still find it fun to discuss language design issues,
and if the issues involve variations on Ada, they seem on-topic enough
to be posted here.  I understand that such discussions might be boring
to those who just want to *use* the language as it is.

- Bob




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

* Re: Why is it Called a Package?
  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
  1 sibling, 2 replies; 41+ messages in thread
From: Jean-Marc Bourguet @ 2000-03-30  0:00 UTC (permalink / raw)


In article <wccya70bg8q.fsf@world.std.com>,
Robert A Duff <bobduff@world.std.com> wrote:
> Geoff Bull <geoff@research.canon.com.au> writes:
>
> > Isn't it a little bit late to be arguing about this?
> [notation for ".all"]
>
> Only if you think Ada 95 is the final word in programming language
> design. ;-)
>
> Of course I don't think anybody's going to change the syntax of Ada at
> this point. But I still find it fun to discuss language design issues,
> and if the issues involve variations on Ada, they seem on-topic enough
> to be posted here. I understand that such discussions might be boring
> to those who just want to *use* the language as it is.

Is there a place where language design issues is the main topic?

-- Jean-Marc


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Why is it Called a Package?
  2000-03-30  0:00             ` Jean-Marc Bourguet
@ 2000-03-30  0:00               ` David Starner
  2000-04-03  0:00               ` Robert A Duff
  1 sibling, 0 replies; 41+ messages in thread
From: David Starner @ 2000-03-30  0:00 UTC (permalink / raw)


On Thu, 30 Mar 2000 18:55:49 GMT, Jean-Marc Bourguet <bourguet@my-deja.com> wrote:
>Is there a place where language design issues is the main topic?

comp.lang.misc gets some of that. It's not exactly an active newsgroup,
and it gets a lot of misc. junk too. 

-- 
David Starner - dstarner98@aasaa.ofe.org
Only a nerd would worry about wrong parentheses with
square brackets. But that's what mathematicians are.
   -- Dr. Burchard, math professor at OSU




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

* Re: Why is it Called a Package?
  2000-03-29  0:00       ` Robert A Duff
@ 2000-03-30  0:00         ` Geoff Bull
  2000-03-30  0:00           ` Robert A Duff
  0 siblings, 1 reply; 41+ messages in thread
From: Geoff Bull @ 2000-03-30  0:00 UTC (permalink / raw)


Isn't it a little bit late to be arguing about this?

Robert A Duff wrote:
> 
> Florian Weimer <fw@deneb.cygnus.argh.org> writes:
> 
> >
> > Robert A Duff <bobduff@world.std.com> writes:
> >
> > > FWIW, I don't like ".all" -- I prefer Pascal's "^".
> >
> > A missing or a surplus dereference operation can make a huge
> > difference, and sometimes, both variants are legal Ada code.  So it's
> > probably better to have a clear mark for this, and "^" is perhaps too
> > easily overlooked.
> 
> But in Ada, dereferences are *optional* in most contexts!  And all
> programmers leave them out when optional, because ".all" is so big and
> ugly and non-intuitive.  My point was that I agree with you that
> dereferences make a huge difference, and so should be explicit.
> Mumble^.Next is plenty explicit for me.
> 
> >...  Personally, I prefer U+2191 (UPWARDS ARROW) to
> > ".all", but the former would involve a quite radical change. ;)
> 
> Well, the "^" of Pascal originally *was* an up arrow.
> 
> - Bob




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

* Re: Why is it Called a Package?
  2000-03-30  0:00     ` Alfred Hilscher
@ 2000-03-31  0:00       ` Anders Wirzenius
  0 siblings, 0 replies; 41+ messages in thread
From: Anders Wirzenius @ 2000-03-31  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]


"Alfred Hilscher" <Alfred.Hilscher@icn.siemens.de> wrote in message
news:38E357D3.870B61D2@icn.siemens.de...
>
>
> Jean-Marc Bourguet wrote:
> > I find quite easy to use programming languages in which keywords are not
> > in my mother language. As a matter of fact, it is perhaps easier, as
>
> I prefer english keywords, too.  If I imagine a program written for
> example in german (my nativ language) it looks for me more to be a joke:
>
> W�hrend I > 0 tue
>   I := I - 1;
> Ende w�hrend;
>
>
> What is the opinion of people with a different character set, e.g.
> Chinese, Arabian, Russian ?

I prefer English, too, but perhaps it comes from that DOS and Windows, what
I have used, has been a little restrictive against letters not belonging to
the basic ASCII character set. In other words I am not sure the *odd*
characters are not causing any unexpected behavior in some level starting
from for example DOS file naming system. Perhaps it is just a question of
being too familiar with the basic ASCII character set (brainwashed against
something odd) .

Niin kauan kuin I>0 suorita
  I := I - 1;
  N�ytt�p��tteen_lukum��r� := N�ytt�p��tteen_lukum��r� + 1;
Loppu Niin kauan kuin;

Anders Wirzenius

anders.wirzenius@pp.qnet.fi






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

* Re: Why is it Called a Package?
  2000-03-30  0:00             ` Jean-Marc Bourguet
  2000-03-30  0:00               ` David Starner
@ 2000-04-03  0:00               ` Robert A Duff
  1 sibling, 0 replies; 41+ messages in thread
From: Robert A Duff @ 2000-04-03  0:00 UTC (permalink / raw)


Jean-Marc Bourguet <bourguet@my-deja.com> writes:

> Is there a place where language design issues is the main topic?

There is some discussion about it on comp.lang.misc, but I'm afraid it's
not usually very interesting to me, because those folks often do not
have the same language design goals as I do, so it's pointless to
discuss detailed design decisions.

The moderator of comp.compilers often allows some discussion of language
design issues, if it's related to compiler design, but he sometimes cuts
it off if he sees it as straying too far from the topic of compilers.
Comp.compilers is an excellent group, by the way -- lots of people who
know what they're talking about post there.  And the moderator does an
excellent job.

- Bob




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

* Re: Why is it Called a Package?
  2000-03-30  0:00           ` Robert A Duff
  2000-03-30  0:00             ` Jean-Marc Bourguet
@ 2000-04-06  0:00             ` Brian Rogoff
  2000-04-07  0:00               ` Pascal Obry
                                 ` (2 more replies)
  1 sibling, 3 replies; 41+ messages in thread
From: Brian Rogoff @ 2000-04-06  0:00 UTC (permalink / raw)


On Thu, 30 Mar 2000, Robert A Duff wrote:
> Geoff Bull <geoff@research.canon.com.au> writes:
> 
> > Isn't it a little bit late to be arguing about this?
> [notation for ".all"]

So, your preference would be to replace ".all" by "^" and make
explicit dereferencing mandatory? 

> Only if you think Ada 95 is the final word in programming language
> design.  ;-)

No, that would be Ada 0X :-)

> Of course I don't think anybody's going to change the syntax of Ada at
> this point.  But I still find it fun to discuss language design issues,
> and if the issues involve variations on Ada, they seem on-topic enough
> to be posted here. 

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. 

The name "package" is just fine. Its not like there is a consensus on 
"module". SML for instance uses "struct". 

> I understand that such discussions might be boring
> to those who just want to *use* the language as it is.

I'd like to use a fixed standard language, and provide feedback so that a 
better one can be designed. I think Ada is quite good as is (my favorite 
low level language) but stealing ideas from C++, Java, Modula-3, and
others is OK as long as the spirit of Ada (static typing, readability
favored over writability, etc.) is preserved.

-- Brian 





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

* Re: Why is it Called a Package?
  2000-04-07  0:00               ` Robert Dewar
@ 2000-04-07  0:00                 ` Brian Rogoff
  2000-04-07  0:00                   ` Hyman Rosen
  2000-04-12  0:00                 ` Comment from the trenchs Robert Brantley
  1 sibling, 1 reply; 41+ messages in thread
From: Brian Rogoff @ 2000-04-07  0:00 UTC (permalink / raw)


Robert, the context of Bob Duff's message was the discussion of a new 
Ada variant without the constraint of backward compatibility. I was 
certainly not proposing revisiting Ada's syntax! I'm surprised that you 
read it that way. Perhaps I should have called it Bab or something else
:-)

Given the character set restrictions, wasn't the issue of "[]" pretty much 
a foregone conclusion?

Yes, uder defined overloadings of [] is a semantic issue, but I wouldn't 
think it a good idea if () were used for functions and arrays. I don't 
like C++'s "()" overloading, only the "[]" one.

-- Brian

On Fri, 7 Apr 2000, Robert Dewar wrote:

> In article
> <Pine.BSF.4.21.0004061305320.6588-100000@shell5.ba.best.com>,
>   Brian Rogoff <bpr@shell5.ba.best.com> wrote:
> 
> > 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.
> 
> 
> There is no point in revisiting this, because nothing has
> changed since Ada 95. The reason for not differentiating
> [] vs () has to do with referential transparency (i.e.
> arrays are conceptually like functions) not with character
> set restrictions.
> 
> Yes, there are arguments on both sides.
> 
> Yes, these arguments are well known since 1960
> 
> Yes, these arguments were brought up during the Ada design
> 
> No, they did not convince people that [] is a good idea
> 
> No, nothing has changed that would suggest revisiting this issue
> 
> The question of overloading indexing is of course a completely
> separate one, since this is not a matter of syntax but
> semantics, and is thus completely orthogonal.
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> 





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

* Re: Why is it Called a Package?
  2000-04-06  0:00             ` Brian Rogoff
  2000-04-07  0:00               ` Pascal Obry
  2000-04-07  0:00               ` Robert Dewar
@ 2000-04-07  0:00               ` Robert A Duff
  2000-04-07  0:00                 ` Brian Rogoff
  2 siblings, 1 reply; 41+ messages in thread
From: Robert A Duff @ 2000-04-07  0:00 UTC (permalink / raw)


Brian Rogoff <bpr@shell5.ba.best.com> writes:

> 
> On Thu, 30 Mar 2000, Robert A Duff wrote:
> > Geoff Bull <geoff@research.canon.com.au> writes:
> > 
> > > Isn't it a little bit late to be arguing about this?
> > [notation for ".all"]
> 
> So, your preference would be to replace ".all" by "^" and make
> explicit dereferencing mandatory? 

I'm saying that if I were to design a language from scratch, that's what
I'd do.  Or, equivalently, that's what I wish the original designers of
Ada 83 had done.  I am certainly not advocating any change to Ada, Ada
0X, Ada 1X, or whatever.

> > Only if you think Ada 95 is the final word in programming language
> > design.  ;-)
> 
> No, that would be Ada 0X :-)

;-)

> I think if the syntax were to be redone I'd like the issue of "()" versus 
> "[]" for array indexing to be reexamined.

I don't think the syntax of Ada is going to be redone at this point; nor
should it.  We've discussed () vs [] here before, and I somewhat agree
with you, but there are arguments both ways, and anyway I don't think it
makes sense to change things.

By the way, the () vs [] debate for array indexing has good arguments on
both sides, but what about aggregates?  It's really a shame that you
can't write a zero-element or one-element positional aggregate in Ada,
and the reason has to do with silly character-set issues.

- Bob




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

* Re: Why is it Called a Package?
  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
  0 siblings, 1 reply; 41+ messages in thread
From: Brian Rogoff @ 2000-04-07  0:00 UTC (permalink / raw)


On Fri, 7 Apr 2000, Robert A Duff wrote:
> Brian Rogoff <bpr@shell5.ba.best.com> writes:
> 
> > 
> > On Thu, 30 Mar 2000, Robert A Duff wrote:
> > > Geoff Bull <geoff@research.canon.com.au> writes:
> > > 
> > > > Isn't it a little bit late to be arguing about this?
> > > [notation for ".all"]
> > 
> > So, your preference would be to replace ".all" by "^" and make
> > explicit dereferencing mandatory? 
> 
> I'm saying that if I were to design a language from scratch, that's what
> I'd do.  Or, equivalently, that's what I wish the original designers of
> Ada 83 had done.  I am certainly not advocating any change to Ada, Ada
> 0X, Ada 1X, or whatever.

Oh, neither was I. I thought it was clear from your post that you were
talking about designing a new, Ada like language, from scratch, given 
the decades of experience with Ada and some other languages. 

I don't advocate any non-backwards-compatible change in Ada. Apparently
that was not clear from my post, so let me make it crystal clear now. I 
even said that I thought typed exceptions would be nice but "too late". 
Thankfully, Tucker Taft corrected me and thought I was being too
conservative with possible changes. Too bad downward and anonymous funargs
weren't included in that list with typed exceptions :-).

> > I think if the syntax were to be redone I'd like the issue of "()" versus 
> > "[]" for array indexing to be reexamined.
> 
> I don't think the syntax of Ada is going to be redone at this point; nor
> should it.  We've discussed () vs [] here before, and I somewhat agree
> with you, but there are arguments both ways, and anyway I don't think it
> makes sense to change things.

Right, but lets say we're talking about a new language, related to Ada in 
the way that Sather is related to Eiffel or Modula-3 is related to
Modula-2 and Oberon. 

I actually find that the overuse of "()" makes code less readable, as I 
look at blocks of Ada I want arrays and functions to look different. 
The two really aren't equivalent, since you can't pass functions as
arguments and return them as results, at least not in a low level
language like Ada.

Someone once posted that this equivalence was useful to them in a real
program but I've never been so fortunate. 

> By the way, the () vs [] debate for array indexing has good arguments on
> both sides, but what about aggregates?  It's really a shame that you
> can't write a zero-element or one-element positional aggregate in Ada,
> and the reason has to do with silly character-set issues.

I agree with you here. 

-- Brian






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

* Re: Why is it Called a Package?
  2000-04-07  0:00               ` Pascal Obry
  2000-04-07  0:00                 ` Samuel T. Harris
@ 2000-04-07  0:00                 ` Paul Graham
  1 sibling, 0 replies; 41+ messages in thread
From: Paul Graham @ 2000-04-07  0:00 UTC (permalink / raw)


Pascal Obry wrote:
> 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.

What about:

    x := Some_Value(1 .. 3);

Changing the implementation from an array to a function is not so easy
here.

If for efficiency reasons you want to re-implement a function as an
array lookup, why not just write a public function as an interface to a
private array, then inline it?

I've always thought that using [] for indexing, slicing, and aggregates
would have made the language much simpler.  How many times have you Ada
experts had to explain to someone that (1) is not a legal array
aggregate?

Another thing that has always bothered me is the omission of parentheses
in a subprogram without arguments.  It results in some peculiar corner
cases in the language.  For instance, sometimes f.x means variable x
declared within function f, and sometimes it is a call to f returning a
record (or an access to record :-) with element x selected.  And I seem
to remember some ambiguities with attributes of sbprograms: is
f'some_attribute an attribute of the function f or of the value returned
by f.  Sure, the LRM has rules to resolve these ambiguities, but why
introduce the ambiguities in the first place?
 
Paul




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

* Re: Why is it Called a Package?
  2000-04-07  0:00               ` Pascal Obry
@ 2000-04-07  0:00                 ` Samuel T. Harris
  2000-04-07  0:00                   ` Stanley R. Allen
                                     ` (2 more replies)
  2000-04-07  0:00                 ` Paul Graham
  1 sibling, 3 replies; 41+ messages in thread
From: Samuel T. Harris @ 2000-04-07  0:00 UTC (permalink / raw)


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 really don't see what would be gained by using "[]"... a more
> C/C++ syntax :)

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 see no compelling reason why array indexing
must be syntactically different from function calls. I do see
that some Ada code, especially when building complex aggregates,
starts to look like LISP (Lots of Insane Silly Parentheses).
I'd like to be able to use {} and [] for different levels
of (). If one then wants to make a style guide issue out of using
[] for indexing and {} to bracket all aggregates, then fine.

This is a very easy and backward compatible change to the
language definition. I suppose Apex would have a problem since
it uses [] for statement prompts. OTOH there are still many
more characters it can use for statement prompt delimiters.

-- 
Samuel T. Harris, Principal Engineer
Raytheon, Aerospace Engineering Services
"If you can make it, We can fake it!"




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

* Re: Why is it Called a Package?
  2000-04-07  0:00                   ` Hyman Rosen
@ 2000-04-07  0:00                     ` Brian Rogoff
  0 siblings, 0 replies; 41+ messages in thread
From: Brian Rogoff @ 2000-04-07  0:00 UTC (permalink / raw)


On 7 Apr 2000, Hyman Rosen wrote:
> Brian Rogoff <bpr@shell5.ba.best.com> writes:
> > Yes, uder defined overloadings of [] is a semantic issue, but I wouldn't 
> > think it a good idea if () were used for functions and arrays. I don't 
> > like C++'s "()" overloading, only the "[]" one.
> 
> But C++'s overloading of () allows referential transparency in template
> code, which can then be written without regard to whether a functor
> parameter is an object or a function. That's a very good thing.

In the case of an Ada like language, I don't think C++ "functors" make 
that much sense, since Ada allows subprograms as generic formal
parameters, and I'd hope that an Ada variant would even allow subprograms
assubprogram parameters, as in Pascal. I guess you could argue that for 
returned functors this overloading would be useful but that's rarer.

Incidentally, considering the title of the thread, we should ask why its
called a "functor" in C++. Seems like an abuse of existing mathematical 
language. I much prefer "function object". 

> I could argue that [] in C++ is an extremely low-level concept which
> should be used only in libraries which need to construct higher-level
> abstractions, and that therefore allowing it to be overloaded is bad,
> because it encourages its use. Just like in Ada, high-level C++ data
> structures such as vectors should use () for indexing.

I'd argue that arrays are a kind of table and having the same notation
for indexing there makes more sense, no matter how the table is 
represented. Functions are something different, *far* more general,
so I prefer to use a different notation for them. For instance it makes
sense to equip tables with equality, but not functions. Well, even if it 
makes sense, it's really hard to check equality in the case of functions
:-)

-- Brian





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

* Re: Why is it Called a Package?
  2000-04-07  0:00                 ` Samuel T. Harris
  2000-04-07  0:00                   ` Stanley R. Allen
@ 2000-04-07  0:00                   ` Brian Rogoff
  2000-04-08  0:00                     ` Robert A Duff
  2000-04-07  0:00                   ` Richard D Riehle
  2 siblings, 1 reply; 41+ messages in thread
From: Brian Rogoff @ 2000-04-07  0:00 UTC (permalink / raw)


[-- 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






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

* Re: Why is it Called a Package?
  2000-04-07  0:00                 ` Samuel T. Harris
@ 2000-04-07  0:00                   ` Stanley R. Allen
  2000-04-07  0:00                   ` Brian Rogoff
  2000-04-07  0:00                   ` Richard D Riehle
  2 siblings, 0 replies; 41+ messages in thread
From: Stanley R. Allen @ 2000-04-07  0:00 UTC (permalink / raw)


"Samuel T. Harris" wrote:
> 
> 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 would vote for [] as substitution for ().  But never {} -- too
many painful memories!

-- 
Stanley Allen
mailto:Stanley_R_Allen-NR@raytheon.com




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

* Re: Why is it Called a Package?
  2000-04-07  0:00                 ` Brian Rogoff
@ 2000-04-07  0:00                   ` Robert A Duff
  2000-04-08  0:00                     ` Brian Rogoff
  0 siblings, 1 reply; 41+ messages in thread
From: Robert A Duff @ 2000-04-07  0:00 UTC (permalink / raw)


Brian Rogoff <bpr@shell5.ba.best.com> writes:

> Oh, neither was I. I thought it was clear from your post that you were
> talking about designing a new, Ada like language, from scratch, given 
> the decades of experience with Ada and some other languages. 

Exactly.  Now how do I get somebody to pay me to do that?  ;-)

- Bob




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

* Re: Why is it Called a Package?
  2000-04-06  0:00             ` Brian Rogoff
  2000-04-07  0:00               ` Pascal Obry
@ 2000-04-07  0:00               ` Robert Dewar
  2000-04-07  0:00                 ` Brian Rogoff
  2000-04-12  0:00                 ` Comment from the trenchs Robert Brantley
  2000-04-07  0:00               ` Why is it Called a Package? Robert A Duff
  2 siblings, 2 replies; 41+ messages in thread
From: Robert Dewar @ 2000-04-07  0:00 UTC (permalink / raw)


In article
<Pine.BSF.4.21.0004061305320.6588-100000@shell5.ba.best.com>,
  Brian Rogoff <bpr@shell5.ba.best.com> wrote:

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


There is no point in revisiting this, because nothing has
changed since Ada 95. The reason for not differentiating
[] vs () has to do with referential transparency (i.e.
arrays are conceptually like functions) not with character
set restrictions.

Yes, there are arguments on both sides.

Yes, these arguments are well known since 1960

Yes, these arguments were brought up during the Ada design

No, they did not convince people that [] is a good idea

No, nothing has changed that would suggest revisiting this issue

The question of overloading indexing is of course a completely
separate one, since this is not a matter of syntax but
semantics, and is thus completely orthogonal.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Why is it Called a Package?
  2000-04-06  0:00             ` Brian Rogoff
@ 2000-04-07  0:00               ` Pascal Obry
  2000-04-07  0:00                 ` Samuel T. Harris
  2000-04-07  0:00                 ` Paul Graham
  2000-04-07  0:00               ` Robert Dewar
  2000-04-07  0:00               ` Why is it Called a Package? Robert A Duff
  2 siblings, 2 replies; 41+ messages in thread
From: Pascal Obry @ 2000-04-07  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1807 bytes --]


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 really don't see what would be gained by using "[]"... a more
C/C++ syntax :)

Pascal.

--

--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- T T I                                    |
--|                       Intranet: http://cln46gb            |
--| Bureau N-023            e-mail: p.obry@der.edf.fr         |
--| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|         http://perso.wanadoo.fr/pascal.obry
--|
--|   "The best way to travel is by means of imagination"







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

* Re: Why is it Called a Package?
  2000-04-07  0:00                 ` Brian Rogoff
@ 2000-04-07  0:00                   ` Hyman Rosen
  2000-04-07  0:00                     ` Brian Rogoff
  0 siblings, 1 reply; 41+ messages in thread
From: Hyman Rosen @ 2000-04-07  0:00 UTC (permalink / raw)


Brian Rogoff <bpr@shell5.ba.best.com> writes:
> Yes, uder defined overloadings of [] is a semantic issue, but I wouldn't 
> think it a good idea if () were used for functions and arrays. I don't 
> like C++'s "()" overloading, only the "[]" one.

But C++'s overloading of () allows referential transparency in template
code, which can then be written without regard to whether a functor
parameter is an object or a function. That's a very good thing.

I could argue that [] in C++ is an extremely low-level concept which
should be used only in libraries which need to construct higher-level
abstractions, and that therefore allowing it to be overloaded is bad,
because it encourages its use. Just like in Ada, high-level C++ data
structures such as vectors should use () for indexing.




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

* Re: Why is it Called a Package?
  2000-04-07  0:00                 ` Samuel T. Harris
  2000-04-07  0:00                   ` Stanley R. Allen
  2000-04-07  0:00                   ` Brian Rogoff
@ 2000-04-07  0:00                   ` Richard D Riehle
  2000-04-08  0:00                     ` Florian Weimer
  2 siblings, 1 reply; 41+ messages in thread
From: Richard D Riehle @ 2000-04-07  0:00 UTC (permalink / raw)


In article <38EE19E0.F0232DB0@Raytheon.com>,
	"Samuel T. Harris" <samuel_t_harris@Raytheon.com> wrote:

       ... [ snipped some stuff preceding this ] ...

>I'd rather see [] and {} be allowed as substitutions for ()
>in a similar way that ! of allowed for |, % is allowed for ",
       ...

Curly braces, yet.  I recall reading somewhere that the reason for
not including curly braces in Ada was due to the worldwide shortage
of {  and  } created by heavy usage of the C family of languages. It
is simply a matter of economics.  Perhaps the same economics applies
to the square brackets.  :-)

Richard Riehle




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

* Re: Why is it Called a Package?
  2000-04-07  0:00                   ` Richard D Riehle
@ 2000-04-08  0:00                     ` Florian Weimer
  2000-04-09  0:00                       ` Stefan Skoglund
  0 siblings, 1 reply; 41+ messages in thread
From: Florian Weimer @ 2000-04-08  0:00 UTC (permalink / raw)


Richard D Riehle <laoXhai@ix.netcom.com> writes:

> Curly braces, yet.  I recall reading somewhere that the reason for
> not including curly braces in Ada was due to the worldwide shortage
> of {  and  } created by heavy usage of the C family of languages. It
> is simply a matter of economics.  Perhaps the same economics applies
> to the square brackets.  :-)

I think Ada's conservative source character set is due to the fact
that the full ASCII set is not available in all parts of the world.
For example, in Germany, a national variant of ISO 646 is still widely
used[1].  On a ISO 646-DE terminal, "@[]\{}|~" is viewed as
"��������", for example.

[1] Given its limitations.  I hope only very few programmers still
have to maintain source code in this character set, but it appears
that some large data processing systems still use it, and a lot of
embedded systems.




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

* Re: Why is it Called a Package?
  2000-04-07  0:00                   ` Brian Rogoff
@ 2000-04-08  0:00                     ` Robert A Duff
  0 siblings, 0 replies; 41+ messages in thread
From: Robert A Duff @ 2000-04-08  0:00 UTC (permalink / raw)


Brian Rogoff <bpr@shell5.ba.best.com> writes:

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

I agree, but for this particular case: the A[I] syntax is the way Pascal
does it, too.

- Bob




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

* Re: Why is it Called a Package?
  2000-04-07  0:00                   ` Robert A Duff
@ 2000-04-08  0:00                     ` Brian Rogoff
  0 siblings, 0 replies; 41+ messages in thread
From: Brian Rogoff @ 2000-04-08  0:00 UTC (permalink / raw)


On Fri, 7 Apr 2000, Robert A Duff wrote:

> Brian Rogoff <bpr@shell5.ba.best.com> writes:
> 
> > Oh, neither was I. I thought it was clear from your post that you were
> > talking about designing a new, Ada like language, from scratch, given 
> > the decades of experience with Ada and some other languages. 
> 
> Exactly.  Now how do I get somebody to pay me to do that?  ;-)

Kids today, all they care about is money...

Seriously, this is of course the reason why a "from scratch" redesign
isn't likely to take place. Perhaps "morphing" Ada 95 into a similar 
language (we have GNAT after all)  would be a better way to go about it. 

There have been a few proposals for (mostly upwards compatible) Ada 
extensions, including Mats Weber's and Jun Shen's. Those would be a 
nice place to start.

> > 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.
> 
> I agree, but for this particular case: the A[I] syntax is the way Pascal
> does it, too.
> 
> - Bob

And Algol-68, and others too. Its just annoying that "because C or C++
does this it must be bad" can be used as an argument. I realize that the 
person doing it this time used a smiley but it seems common. I think I'd 
still like Ada if "begin... end" were replaced by "{}", since the surface 
syntax, while important, is not nearly as important as the semantics. 

-- Brian






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

* Re: Why is it Called a Package?
  2000-04-08  0:00                     ` Florian Weimer
@ 2000-04-09  0:00                       ` Stefan Skoglund
  0 siblings, 0 replies; 41+ messages in thread
From: Stefan Skoglund @ 2000-04-09  0:00 UTC (permalink / raw)


Florian Weimer wrote:
> 
> I think Ada's conservative source character set is due to the fact
> that the full ASCII set is not available in all parts of the world.
> For example, in Germany, a national variant of ISO 646 is still widely
> used[1].  On a ISO 646-DE terminal, "@[]\{}|~" is viewed as
> "��������", for example.
> 
> [1] Given its limitations.  I hope only very few programmers still
> have to maintain source code in this character set, but it appears
> that some large data processing systems still use it, and a lot of
> embedded systems.

The keyboards usually doesn't provide direct access to {}[] and
so on.
For me it is AltGR-( and so on. Shift-( is probably a little better.




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

* Re: Comment from the trenchs
  2000-04-07  0:00               ` Robert Dewar
  2000-04-07  0:00                 ` Brian Rogoff
@ 2000-04-12  0:00                 ` Robert Brantley
  2000-04-13  0:00                   ` Jeff Carter
  1 sibling, 1 reply; 41+ messages in thread
From: Robert Brantley @ 2000-04-12  0:00 UTC (permalink / raw)




Robert Dewar wrote:

> In article
> <Pine.BSF.4.21.0004061305320.6588-100000@shell5.ba.best.com>,
>   Brian Rogoff <bpr@shell5.ba.best.com> wrote:
>
> > 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.
>
> There is no point in revisiting this, because nothing has
> changed since Ada 95. The reason for not differentiating
> [] vs () has to do with referential transparency (i.e.
> arrays are conceptually like functions) not with character
> set restrictions.
>
> Yes, there are arguments on both sides.
>

Only in the mind of a language designer having a theoretical
discussion.  Every week I have to look at Ada code I have never seen
before.  Having situations where array access looks just like subprogram
calls is a BAD thing.  It decreases the readability of the source, makes
it harder to maintain, harder to validate and harder to test.  It makes
errors more likely. It makes the code more expensive and less reliable.

The same thing is true about optional parenthesis on subprogram calls
taking no parameters, although to a much less degree.

Any argument based upon referentail transparency pales to insignificance
when compared to the affect this has on real-world development and
maintainability.

If you are developing a new Ada-like language, please, structure the
syntax so that array acesses and subprogram calls are differentiated and
obvious.

JMHO

Robert Brantley
robert.brantley@lmco.com

>
> Yes, these arguments are well known since 1960
>
> Yes, these arguments were brought up during the Ada design
>
> No, they did not convince people that [] is a good idea
>
> No, nothing has changed that would suggest revisiting this issue
>
> The question of overloading indexing is of course a completely
> separate one, since this is not a matter of syntax but
> semantics, and is thus completely orthogonal.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





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

* Re: Comment from the trenchs
  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
  0 siblings, 1 reply; 41+ messages in thread
From: Jeff Carter @ 2000-04-13  0:00 UTC (permalink / raw)


Robert Brantley wrote:
> discussion.  Every week I have to look at Ada code I have never seen
> before.  Having situations where array access looks just like subprogram
> calls is a BAD thing.  It decreases the readability of the source, makes

and also

> The same thing is true about optional parenthesis on subprogram calls
> taking no parameters, although to a much less degree.

Parentheses on subprogram calls with no actual parameters are not
optional, they are illegal. Perhaps when you have learned the language
your opinion of parentheses for indexing will change.

-- 
Jeff Carter
"Son of a silly person."
Monty Python & the Holy Grail




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

* Re: Comment from the trenchs
  2000-04-13  0:00                   ` Jeff Carter
@ 2000-04-17  0:00                     ` Robert Brantley
  0 siblings, 0 replies; 41+ messages in thread
From: Robert Brantley @ 2000-04-17  0:00 UTC (permalink / raw)




Jeff Carter wrote:

> <snip>
>
> Parentheses on subprogram calls with no actual parameters are not
> optional, they are illegal. Perhaps when you have learned the language
> your opinion of parentheses for indexing will change.
>
> --
> Jeff Carter
> "Son of a silly person."
> Monty Python & the Holy Grail

Your right, they are.  But, then I have to ask myself wether the time would be
more profitable spent learning Java.

Robert Brantley
robert.brantley@lmco.com





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

end of thread, other threads:[~2000-04-17  0:00 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-27  0:00 Why is it Called a Package? Gary Scott
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 ` 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                 ` Samuel T. Harris
2000-04-07  0:00                   ` Stanley R. Allen
2000-04-07  0:00                   ` Brian Rogoff
2000-04-08  0:00                     ` Robert A Duff
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                 ` Paul Graham
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   ` Ken Garlington
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-29  0:00   ` Florian Weimer
2000-03-27  0:00 ` Ted Dennison

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