comp.lang.ada
 help / color / mirror / Atom feed
* Ada language revision
@ 1988-11-14 13:20 Stanley Roger Allen, AdaDude
  1988-11-15 23:28 ` Wilmer Rivers
  0 siblings, 1 reply; 79+ messages in thread
From: Stanley Roger Allen, AdaDude @ 1988-11-14 13:20 UTC (permalink / raw)




	Well, time is pressing on and the review has begun for
analyzing anew changes that should be made to the Ada language.
Through a variety of sources, a number of not-very-bright statements
have come to our attention concerning "improvements" to the Ada
language that should be "easily incorporated" into the the 1994
revision.

	A lot of these people are certainly driven by nothing more
sinister than the "feature junkie" complex (cf. Dijkstra's Turing
Award lecture, 1972).  What makes a lot of these suggestions dangerous
is more that just a lack of appreciation for the language design and
structure.  We are also seeing a deep misapprehension of what the
goals of the Ada program are to begin with.  We are not trying to
create a research engine, or a summation of the latest programming
language paradigms, or a fault-tolerant distributed operating system, 
etc.  Those who are to make decisions about the future of the Ada 
language need discover what exactly we *are* trying to create.

	To give a one-line answer to this question would be to defeat
the purpose of this missive.  I am proposing that anyone who wishes to
make suggestions for improving the language, adding new features,
deleting language elements, or change the organization of the language
(even in ways that may seem trivial) should first do their homework.
There is a specific body of knowledge that you should possess when
approaching this topic.  Have you read the Steelman document and/or
its predecessors?  (Do you even know what the Steelman document is?) 
Have you read the "Rationale for the Design of the Ada Language"?  Do
you understand the type system of the Ada language?  Have you been
looking through the megabytes of textual commentaries that have been
accumulating since the beginning of the Ada program?  Does the LRM
still confuse you? 

	Perhaps there should be a "required reading list" and
"qualifying exams" for Ada language maintainers.  Perhaps there is; I
don't know.  Jean Ichbiah says that many languages previous to Ada
followed a three-step process for their creation: "shoot, aim, think".
Ada is among the languages that reversed the process, which is one of
the reasons for the great success it has become.  In maintaining the 
language, thinking should also come first.  Part of that thinking is 
going back to previous thinking and absorbing it.  Any other path is 
pure hubris.

					Stanley Allen
					allen@star.stanford.edu

^ permalink raw reply	[flat|nested] 79+ messages in thread
* Collective response to := messages
@ 1988-11-28 22:19 Geoff Mendal
  1988-11-29 14:39 ` Dennis Doubleday
                   ` (2 more replies)
  0 siblings, 3 replies; 79+ messages in thread
From: Geoff Mendal @ 1988-11-28 22:19 UTC (permalink / raw)


I will respond briefly to some of the replies made to my original
assignment overloading message.  Lines with ">>" are from my original
message, lines with ">" are responses to my original message.  I am a
bit shocked that some people apparantly agree with me... I'm not used
to that sort of thing.

>Date: 23 Nov 88 22:57:59 GMT
>From: hubcap!billwolf@gatech.edu  (William Thomas Wolfe,2847,)
>Subject: Ada Language Change: Assignment Overloading
>
>> 1. Why simply restrict it to assignment?  Why not include membership,
>>    short-circuit control forms, indexing, selection, attributes, etc.?
>>    These are all basic operations....
>
>   First, assignment is a "fundamental" operation; except for attributes,
>   the other things you've suggested apply only to specific classes of
>   ADTs.  As for attributes, I think we could live without them if 
>   appropriate procedures and functions were defined over the predefined
>   ADTs; having attributes for predefined ADTs and functions for user-defined
>   ADTs is another inconsistency.  Procedures and functions are definitely
>   necessary; the attribute mechanism is not.

Wrong.  Membership, qualification, attributes, and explicit type conversion
are all "fundamental" operations defined for EVERY type.  To argue that
assignment is special requires more justification than "we can live without
X and Y is necessary".  Who can live without X?  I can most certainly live
without assignment overloading.  Does this mean that overloading assignment
is a good/bad idea?  Nonsense.  Rethink your argument.

>   Another reason is that assignment procedures need to be invoked as part
>   of the evaluation of a user-defined ADT which is passed by value.  No
>   similarly vital function is performed by the other operations suggested.

I don't understand this at all.  You are assuming pass by value for an
ADT?  Rediculous.  The LRM only states that scalars and access values
are passed by copy.  In general, for an ADT, you cannot assume pass by
value and if your program depends on it, your program will execute
erroneously.  Justifying a language change based on a set of programs
which are known to execute erroneously it itself an erroneous argument.
If an "assignment procedure needs to be invoked as part of the evaluation
of a user-defined ADT" then one can explicitly write the Ada code
necessary for this.  Default components for records provide a simple
solution here.  There are other solutions as well.  None of the solutions
REQUIRE assignment to be overloaded.

>   The argument that the operations listed (except assignment and attributes)
>   should be user-programmable with respect to user-defined ADTs is reasonable,
>   but clearly assignment is in a higher class of importance than the others.

I strongly disagree.  Assignment is assignment.  A relational operator
is a relational operator.  Are we going to change the language by
taking a popular vote of which operations are "higher class" than
others?  Such justification for a language change is rediculous.  So
far, I have seen no justification why assignment should be overloaded
and not other basic operations.  Consider usability, readability,
understandibility, etc.  These should drive the justification, not
someone's arbitrary "higher class" argument.  My argument is that
while readability might be increased, understandability will be
diminished and therefore we should reject the notion that overloading
assignment is a good idea.  The designers of Ada went out of their way
to make typing Ada programs more difficult/time-consuming so that
understanding them would be easier.  Any language change should not
compromise understandability for the sole gain of making programs
easier to type.

>Date: 23 Nov 88 19:13:34 GMT
>From: trent@unix.sri.com  (Ray Trent)
>Subject: Ada Language Change: Assignment Overloading
[some verbage deleted]
>
>This standard argument against allowing the overloading of the ":="
>operator ignores the fact the programmers may want *semantics*
>in their type declarations instead of just syntax. Types are not 
>static objects that can be completely defined at compile time,
>however much the designers of Ada want to think they are.
[fraction example deleted]
>
>The Ada apolgists would have us write the semantics for ensuring
>LCD form for the type Fraction into *each and every operator*
>that acts upon 2 items of this type, instead of having that 
>functionality in the assignment operator, where it belongs. The point 
>is, readable or not, ":=" should validly ensure the *semantics* of
>every type it is defined for, as well as the pure syntactical elemants.
[more fraction examples deleted]

First, assignment is NOT an operator.  It is a basic operation.
Operators are completely different in that they follow different
scope/visbility rules and are afforded some luxeries (overloading)
not currently available to basic operations.  I tried to make this
point clear in my original message but it is obvious that still not
everyone understands the difference.  Read the LRM and be enlighted.

Now, of course programmers want semantics in their type declarations
and I believe that Ada provides some of these semantics through
predefined behavior of basic operations and operators.  But I disagree
that having the complete semantics for a type defined in an
"assignment operator" is appropriate or even desired.  Assignment
already has a very well defined semantics.  Read the LRM.  So what is
the problem?  You don't like those semantics and you would prefer to
alter them?  Fine, but I fail to see why ":=" has to be the syntagma which
carries your favorite semantics (which may not be my favorite
semantics).

One of the examples that I deleted above was "A := B / C;"
where A, B, and C were of some ADT (Fraction).  If I understand the
argument for placing the semantics in assignment instead of having the
programmer define the semantics in each user-defined operation, then
how would the semantics of passing the expression "B / C" to some
subprogram formal be handled?  There is no "assignment" here.  The
semantics have to be part of the division operation.  Perhaps you
are arguing that indeed "assignment semantics" should be a part of
EVERY operation.  This is a completely different language change,
far more involved than a "simple" overloading of "assignment".
Perhaps those who are involved with Ada formal definition projects
(DDC, etc.) can shed some light on what is involved here and if
such would be useful.

>The argument that pre-processors can be used to acheive this effect is
>bull. It ignores the absolute fact that *no one* maintains, reads, or
>is expected to understand the processed code. This is a null argument.

Quite the contrary.  The whole idea of a pre-processor or translation
tool is to remove the need to "read" the processed version.  How many
Ada programmers spend their time disassembling and reading the output
of their compilations?  A compiler is a translation tool.  The idea
being that Ada is more readable/understandable/etc. than assembly.  So
why is it that defining a mapping from some pre-processor to Ada is
met with such cynicism?  It simply provides an additional layer of
abstraction, which, the last time I looked, was thought to be a good
idea.

Those who are convinced that there is nothing above/beyond Ada should
continue to keep their blinders on so that they won't have to worry
about keeping up with computer science and software engineering.  If
others in our field had adopted this attitude, we'd still be
programming by wire wrapping and debugging with oscilloscopes.  (It is
a sad commentary that there are still Ada programmers out there who
still do not understand the need for and utility of an APSE.  You can
spot them right away... they're the ones who think that the only way
to improve/change things is by modifying the language.)

>Date: 24 Nov 88 01:55:31 GMT
>From: hp-sdd!ncr-sd!ncrcae!hubcap!billwolf@hplabs.hp.com  (William Thomas Wolfe,2847,)
>Subject: Ada Language Change: Assignment Overloading
>
>   Why can't an overloadable operation remain as a basic operation?
>
>   In order to preserve compatibility, the "old" interpretation of
>   assignment could be kept as the outermost interpretation (deepest
>   in the background), available as a default assignment procedure.

Yech!  The current language definition is clear and consistent.  A
basic operation (such as assignment) cannot be overloaded.
Overloading is defined only for subprograms, single entries,
operators, and enumeration literals.  My point was that if assignment
was to be overloaded, then it would most likely have to be
reclassified as an operator or a procedure.  Otherwise, this language
change would require much more work.  Having assignment as the only
basic operation which could be overloaded makes the semantics of
"assignment" more murky.  Overloading is complex enough without adding
a new special case to it.  And for what benefit?  I still haven't seen
a response that illustrates a useful case where overloading assignment
would do anything useful.  Does anyone have such a case?  Or is this
basically a theoretical argument whereby the impact of a language
change will not be understood until it has been made and programmers
start to experiment with it?

>>    Program provers might rely on the fact that if no exception is raised 
>>    during the "assignment", that the the value is assigned to the object.  
>
>   And what about the overloadable relational operators???
>
>   Program provers cannot now assume that "=" really means equality,
>   nor can they assume that some side effect will not occur during the
>   evaluation of an equality operator.  There is plenty of precedent here.
>   If we go ahead and overload assignment, the program prover will be able
>   to exercise one simple, consistent rule: "Assume nothing".  I think this
>   is an excellent mode of thought to force a program prover into.  

Well, not really.  Since "=" can only be overloaded by the user for
limited types, it is not a good example.  "*" is a better example.
But the point is that the current semantics of assignment do allow
program provers to make certain assumptions which make the job of
writing a program prover easier.  While it is certainly possible to
write a program prover which does not make use of the current
assignment semantics, it is far harder to do so.  The point being that
there exist applications of Ada out there which will suffer somewhat
from this proposed language change.  Whether this is a desired result
is debatable (do we really want to force the program proving folks to
go back and undertake a major redesign because a few programmers hate
to type ASSIGN?).

>> The proponents of overloading assignment have also overlooked other
>> less costly solutions such as pre-processors that would transform
>> "overloaded assignment" into Ada procedure calls, implementation-defined
>> pragmas, etc.
>
>    Wrong.  The ability to cleanly define abstract data types 
>    is very much a language issue.  Implementation-defined pragmas
>    would annihilate portability.  Preprocessors would have one hell
>    of a time implementing "If this procedure call involves passing
>    a user-defined ADT by value, then generate a temporary variable
>    of that type, invoke ASSIGN on that temporary (assuming we adhered
>    to the convention of using the name ASSIGN rather than, for example,
>    COPY or DUPLICATE), and pass the temporary instead, and remember 
>    to invoke DESTROY on the temporary afterward"...
>
>    There's no way around it.  Assignment needs to be overloadable.

I don't understand this argument at all.  Clearly one can write ASSIGN
procedures by hand to solve this sort of thing.  The only difference
is that ASSIGN (X, Y) has to be written instead of "infix" X := Y.
So why does assignment need to be overloaded?  And if one can write
the code with the intended semantics by hand, then why cannot an
advanced APSE tool do so?  Is your argument that the state of APSE
technology is not sufficient to solve the problem, and therefore we
have to solve it as a language problem?  This is again a silly argument
for making a language change and would prove my case that this is
indeed an APSE issue, not a language issue.

***********
Since overloading of assignment is not a very important issue, I'll
refrain from making any further comments about it.  I'll get back to
doing more important things... writing pre-processor tools for Ada.

gom

^ permalink raw reply	[flat|nested] 79+ messages in thread
* Re: limited private types
@ 1988-12-03 23:10 Erland Sommarskog
  0 siblings, 0 replies; 79+ messages in thread
From: Erland Sommarskog @ 1988-12-03 23:10 UTC (permalink / raw)


Ron Guilmette (rfg@nsc.nsc.com.UUCP) wants to be able to defer the 
implementation of a (limited) private type to the body of his package.
He writes:
>Anyway, I *do* know about the special tricky Ada rule which allows you
>to defer a full type definition until the corresponding package body
>...
>Basically, about the only thing you can do with such objects is to pass
>them as actual parameters to subprograms.  Obviously, if you do this, then
>for each such subprogram, the actual *definition* of the given subprogram
>must be compiled only *after* the full type declaration has already been
>compiled.
>...
>Since any given Ada compiler must generate code to copy scalar actual
>parameters into their corresponding formals, and since the most efficient
>...

Since you have thought so much on the not-so-obvious problem of parameter 
passing, you must have found the answer to the more obvious problem of
heap and stack allocation as trivial. I am probably stupid, because I
fail to see any attractive solutions to that. If in my block I declare:
   A : A_limited_type;
   B : Another_limited;
   C : ARRAY(1..20) OF Yet_another_limited;
If the implementation of the types in available in the specification 
of the types originating package, there is no problem. But if you defer
them to the body, and do not allow cheating with pointers? Enlighten
me, how to you allocate them on the stack? Implicit pointers? Some
implicit size-telling function called at run-time? Not very attractive,
since the place on the stack for other local variables is dependent 
of the size of the types.

To be straight I think that the pointer "trick" serves our needs 
perfectly here, and that your proposal is just YAUAC. (Yet Another 
Unnecessary Ada Change.)
-- 
Erland Sommarskog
ENEA Data, Stockholm
sommar@enea.se
"Frequently, unexpected errors are entirely unpredictable" - Digital Equipment

^ permalink raw reply	[flat|nested] 79+ messages in thread
* Memory Access Question
@ 1989-07-26 20:34 tony
  1989-07-27 13:06 ` richard a hammond
  1989-07-29  0:00 ` Brian Sullivan
  0 siblings, 2 replies; 79+ messages in thread
From: tony @ 1989-07-26 20:34 UTC (permalink / raw)



Does anyone have a code fragment that demonstrates how to access memory?
I am looking for a program that tests memory.  Instruction and data space
are seperate on my machine and I am trying to test RAM from 0 to n.  I have
looked at the "access" data type and can't figure out how to initialize it
to 0 let alone increment the pointer by 1.  The representation
specification doesn't seem to provide the answer either.  Any and all help
is greatly appreciated.

Tony Becker			Phone: 407-356-9334
University of Central Florida	csnet: tony@ucf-cs.ucf.edu
Orlando, FL  32816		uucp:  {ihnp4!decvax,peora}!ucf-cs!tony

^ permalink raw reply	[flat|nested] 79+ messages in thread
* limited private types
@ 2000-04-26  0:00 r_srinivasan
  2000-04-26  0:00 ` Marin D. Condic
                   ` (2 more replies)
  0 siblings, 3 replies; 79+ messages in thread
From: r_srinivasan @ 2000-04-26  0:00 UTC (permalink / raw)


folks,

I hope someone has a reasonable suggestion for the following problem :

I am developing a file processing application that requires opening and
closing of an unspecified number of files. Ideally i would like to
build a "stack" of "files".

Currently I am using text_io package. Unfortunately the type
text_io.file_type is a "limited private" type and this means no
assignments. I have been able to get around this somewhat by using
File_access type but there is no "close" procedure that will take a
file_access.

Any and all ideas would be appreciated.

regards

srini


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




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

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

Thread overview: 79+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-11-14 13:20 Ada language revision Stanley Roger Allen, AdaDude
1988-11-15 23:28 ` Wilmer Rivers
1988-11-16 19:06   ` William Thomas Wolfe,2847,
1988-11-17 15:34     ` Stephe Leake
1988-11-18 16:39       ` Steve Tynor
1988-11-18 19:22       ` Ron Guilmette
1988-11-23 22:22       ` William Thomas Wolfe,2847,
1988-11-29 15:35         ` Stephe Leake
1988-11-18  0:32     ` Ron Guilmette
1988-11-22 14:37       ` Stephe Leake
1988-11-23 13:37         ` Dennis Doubleday
1988-11-23 19:41           ` Steve Tynor
1988-11-23 21:14             ` Richard Pattis
1988-11-25 20:36             ` Robert Firth
1988-11-29 15:12           ` limited private types Stephe Leake
1988-12-01 23:06             ` Ron Guilmette
1988-12-05  1:48               ` Paul Stachour
1988-12-05 12:31                 ` Reference Semantics William Thomas Wolfe,2847,
1988-12-06  0:29                   ` Paul Stachour
1988-12-07  1:07                     ` Reference Semantics, assignment overloading, etc Ray Trent
1988-12-08 17:36                       ` Reference Semantics, assignment ryer
1988-12-06 16:56               ` limited private types ryer
1988-12-06 20:09               ` stt
1988-12-07 15:51               ` Stephe Leake
1988-11-21 15:40   ` Ada language revision stt
  -- strict thread matches above, loose matches on Subject: below --
1988-11-28 22:19 Collective response to := messages Geoff Mendal
1988-11-29 14:39 ` Dennis Doubleday
1988-11-29 21:08 ` Ray Trent
1988-11-30 14:37   ` Stephe Leake
1988-12-01 14:54     ` David S. Rosenblum
1988-12-02 20:21       ` William Thomas Wolfe,2847,
1988-12-04 21:15         ` David S. Rosenblum
1988-12-04 23:27           ` William Thomas Wolfe,2847,
1988-12-05 14:46             ` David S. Rosenblum
1988-12-05 21:23               ` William Thomas Wolfe,2847,
1988-12-07 17:33                 ` Stephe Leake
1988-12-07 16:03               ` Definition of pass by reference Robert Eachus
1988-12-07 17:15             ` Collective response to := messages Stephe Leake
1988-12-07 16:07       ` Stephe Leake
1988-12-09  3:15         ` David S. Rosenblum
1988-12-01 21:31     ` Ray Trent
1988-12-07 16:21       ` Stephe Leake
1988-11-30 16:29   ` David S. Rosenblum
1988-11-30 18:29     ` William Thomas Wolfe,2847,
1988-11-30 22:28       ` David S. Rosenblum
1988-12-01  3:09         ` William Thomas Wolfe,2847,
1988-12-01 15:16           ` David S. Rosenblum
1988-12-02 19:31             ` William Thomas Wolfe,2847,
1988-12-04 21:03               ` David S. Rosenblum
1988-12-05  2:34                 ` William Thomas Wolfe,2847,
1988-12-05 14:07                   ` David S. Rosenblum
1988-12-07 17:26                     ` Stephe Leake
1988-12-06 19:16                 ` Collective response to := messa stt
1988-12-09  3:39                   ` David S. Rosenblum
1988-11-30 19:13     ` CORRECTION Re: Collective response to := messages David S. Rosenblum
1988-12-01 18:31     ` Ray Trent
1988-12-02 14:49       ` David S. Rosenblum
1988-12-05 17:33         ` Collective response to := messa stt
1988-11-30 18:24   ` Collective response to := messages Robert Eachus
1988-12-02 14:58     ` David S. Rosenblum
1988-12-02 19:34   ` Mark C. Adolph
1988-12-05 17:15     ` Collective response to := messa stt
1988-11-29 21:44 ` Collective response to := messages William Thomas Wolfe,2847,
1988-12-03 23:10 limited private types Erland Sommarskog
1989-07-26 20:34 Memory Access Question tony
1989-07-27 13:06 ` richard a hammond
1989-07-27 18:53   ` Ray Trent
1989-07-28  0:48     ` Mike Murphy
1989-08-02 13:23       ` Mike Walsh
1989-08-02 20:20         ` Mike Murphy
1989-07-29  0:00 ` Brian Sullivan
2000-04-26  0:00 limited private types r_srinivasan
2000-04-26  0:00 ` Marin D. Condic
2000-04-27  0:00   ` r_srinivasan
2000-04-28  0:00     ` Jean-Pierre Rosen
2000-04-27  0:00 ` Ray Blaak
2000-04-27  0:00   ` r_srinivasan
2000-04-27  0:00     ` tmoran
2000-04-27  0:00 ` Marc A. Criley

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