comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Redefinition of "=", elaboration and learning Ada
Date: 1997/04/29
Date: 1997-04-29T00:00:00+00:00	[thread overview]
Message-ID: <E9Esu1.594@world.std.com> (raw)
In-Reply-To: 3365E879.567F@elca-matrix.ch


In article <3365E879.567F@elca-matrix.ch>,
Mats Weber  <Mats.Weber@elca-matrix.ch> wrote:
>Another reason why I think we should have... no reemergence of
>predefined operations ...

>Having predefined "=" reemerge in strange places when it's been
>redefined is also counterintuitive ...

You talk about "=" specifically, but above you say "operators",
presumably meaning all of them.  You still haven't given a complete
definition of when *all* operators should and should not "reemerge".

>And then try explaining to a novice programmer, without making him
>believe that the language definition is flawed, that if he makes his
>type tagged then everything will work fine :-)

OK, but try to explain to the novice why Text_IO.Integer_IO doesn't
work, because "mod" is redefined.

>What the user sees when he discovers packages and private types is that
>he can define abstractions that he can use without knowing how they are
>implemented. What he sees when he discovers a library of generic
>components is that he can instantiate them and then use them. In both
>cases, he hits what is IMO a severe pitfall: reemergence breaks his
>abstraction, and he (potentially) gets Program_Error when he
>instantiates his generic.

But having the user-defined operator used in a generic has a similar
problem.  How can I write Text_IO.Integer_IO (or a similar generic)?
How do I write the code that converts an integer to a string, if I can't
get my hands on the predefined ops?

I agree with you about elaboration -- the current rules are a mess.
And I mostly agree with you about "=".  But I don't see how you can
sensibly extend it to other ops.  Perhaps one wants to have *both*
available -- Eiffel is sort of like that.  You define something like
Basic_Compare and Compare, and then never override Basic_Compare (freeze
it).  So then a client can choose one or the other.  By default, they do
the same thing, but subclasses can override Compare.

- Bob




  reply	other threads:[~1997-04-29  0:00 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-18  0:00 AQ&S Guidance on pragma Elaborate_Body JP Thornley
1997-04-18  0:00 ` Robert A Duff
1997-04-21  0:00   ` Michael F Brenner
1997-04-22  0:00     ` Robert A Duff
1997-04-18  0:00 ` Robert Dewar
1997-04-19  0:00   ` Michael Paus
1997-04-19  0:00     ` Robert A Duff
1997-04-21  0:00       ` Robert Dewar
1997-04-23  0:00         ` Robert A Duff
1997-04-23  0:00           ` Robert Dewar
1997-04-24  0:00             ` Robert A Duff
1997-04-24  0:00               ` Robert Dewar
1997-04-24  0:00                 ` Robert Dewar
1997-04-25  0:00                   ` Robert A Duff
1997-04-25  0:00                 ` Mats Weber
1997-04-25  0:00                   ` Robert I. Eachus
1997-04-26  0:00                     ` Nick Roberts
1997-04-26  0:00                       ` Robert Dewar
1997-04-28  0:00                         ` Robert I. Eachus
1997-04-29  0:00                           ` Robert Dewar
1997-04-29  0:00                             ` Robert I. Eachus
1997-04-27  0:00                   ` Robert Dewar
1997-04-28  0:00                     ` Mats Weber
1997-04-29  0:00                     ` Redefinition of "=", elaboration and learning Ada Mats Weber
1997-04-29  0:00                       ` Robert A Duff [this message]
1997-04-30  0:00                         ` Mats Weber
1997-04-26  0:00                 ` AQ&S Guidance on pragma Elaborate_Body Nick Roberts
1997-04-26  0:00                   ` Robert Dewar
1997-04-24  0:00           ` Mats Weber
1997-04-24  0:00             ` Robert A Duff
1997-04-24  0:00               ` Robert Dewar
1997-04-25  0:00             ` Robert Dewar
1997-04-20  0:00     ` Robert Dewar
1997-04-21  0:00     ` Michael F Brenner
1997-04-23  0:00       ` Robert Dewar
1997-04-24  0:00         ` Laurent Guerby
1997-04-24  0:00         ` Matthew Heaney
1997-04-24  0:00           ` Robert Dewar
1997-04-24  0:00           ` Robert A Duff
1997-04-24  0:00           ` Jon S Anthony
1997-04-24  0:00             ` Matthew Heaney
1997-04-26  0:00               ` Robert Dewar
1997-04-26  0:00                 ` Matthew Heaney
1997-04-27  0:00                   ` Robert Dewar
1997-04-29  0:00                     ` John G. Volan
1997-04-29  0:00                       ` Matthew Heaney
1997-04-30  0:00                         ` Jon S Anthony
1997-05-01  0:00                         ` John G. Volan
1997-05-02  0:00                           ` Booch "forms" and child packages [was: AQ&S Guidance on pragma Elaborate_Body] John G. Volan
1997-05-02  0:00                         ` AQ&S Guidance on pragma Elaborate_Body John G. Volan
1997-04-26  0:00               ` Nick Roberts
1997-04-26  0:00                 ` Matthew Heaney
1997-04-26  0:00                 ` Robert A Duff
1997-04-25  0:00             ` Robert Dewar
1997-04-25  0:00           ` Michael F Brenner
1997-04-26  0:00             ` Nick Roberts
1997-04-20  0:00 ` Doug Smith
1997-04-20  0:00   ` Robert Dewar
1997-04-21  0:00     ` Matthew Heaney
1997-04-21  0:00       ` Robert A Duff
1997-04-21  0:00         ` Robert Dewar
1997-04-22  0:00           ` Robert A Duff
1997-04-24  0:00             ` Robert Dewar
1997-04-21  0:00         ` Matthew Heaney
1997-04-21  0:00           ` Robert A Duff
1997-04-21  0:00           ` Matthew Heaney
1997-04-22  0:00             ` Mats Weber
1997-04-22  0:00             ` Robert A Duff
1997-04-22  0:00               ` Matthew Heaney
1997-04-22  0:00                 ` Robert A Duff
1997-04-22  0:00                   ` Matthew Heaney
1997-04-23  0:00                     ` Robert A Duff
1997-04-24  0:00                       ` Matthew Heaney
1997-04-24  0:00                         ` Robert A Duff
1997-04-25  0:00                       ` Robert Dewar
1997-04-23  0:00                     ` Robert Dewar
1997-04-24  0:00                 ` Robert Dewar
1997-04-24  0:00                   ` Robert A Duff
1997-04-23  0:00             ` Robert Dewar
replies disabled

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