comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Two ideas for the next Ada Standard
Date: 1996/09/06
Date: 1996-09-06T00:00:00+00:00	[thread overview]
Message-ID: <dewar.842012852@schonberg> (raw)
In-Reply-To: 50opma$kos@goanna.cs.rmit.edu.au


Richard said

"That's one of the things I like about the old Russell type system:
you can derive a new type by weakening.  I can say "T is integer
except that it doesn't have these operations."

>This includes add, multiply, subtract, 'Image, and all the
>other built in stuff,

That is indeed a weakness in Ada.  It should be possible to exclude
such things.  It is presently possible to do that by exporting a
private type and replicating all and only the things I _do_ want to
offer, so I don't call it a defect."



Richard, you can't quite do 100% of what you want, since you cannot exclude
attributes like Image, but you are obviously missing an important capability
in Aa 95.

	type x is range 1..10;
        function "+" (a,b : x) return x is abstract;

causes the addition operator to be unavailable for this type.
This is how weakening is done in Ada 95.

In general it is a good idea to turn any statement of the form "You cannot
do xxx in Ada 95" to a question "How do you do xxx in Ada 95?" unless you
are very sure of your facts. That way you avoid stating misconceptions as
facts on the newsgroups.

It's an interesting point that it is a pity that there is no way to suppress
attributes. That's particularly true in the floating-point case, where there
are huge numbers of attributes, or in the enumeration type case, where it
would be nice to suppress Pos, Succ, and Pred.

The other operation that you cannot suppress is the ability to take
subranges, which, particularly in the enumeration type case, can be
unfortunate. The reason is that it allows clients to depend on the
order of items in the enumeration definition, which is really the
business of the defining package. You can supppress the comparison
operations, but not the IN and NOT IN operations on user defined
subtypes, which are essentially semanticaly equivalent to the
comparison operations.





  reply	other threads:[~1996-09-06  0:00 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-31  0:00 Re:Two ideas for the next Ada Standard dulman
1996-09-01  0:00 ` Two " Robert Dewar
1996-09-03  0:00   ` Larry Kilgallen
1996-09-03  0:00   ` Jonas Nygren
1996-09-03  0:00     ` Richard A. O'Keefe
1996-09-03  0:00       ` Jonas Nygren
1996-09-03  0:00         ` Robert A Duff
1996-09-04  0:00         ` Richard A. O'Keefe
1996-09-04  0:00         ` Robert Dewar
1996-09-03  0:00       ` Robert A Duff
1996-09-03  0:00         ` Adam Beneschan
1996-09-03  0:00         ` Dale Stanbrough
1996-09-04  0:00           ` Two " Richard A. O'Keefe
1996-09-04  0:00         ` Robert Dewar
1996-09-04  0:00         ` Richard A. O'Keefe
1996-09-05  0:00           ` Robert Dewar
1996-09-06  0:00             ` Richard A. O'Keefe
1996-09-05  0:00           ` Robert A Duff
1996-09-06  0:00             ` Richard A. O'Keefe
1996-09-06  0:00               ` Robert Dewar [this message]
1996-09-10  0:00                 ` Richard A. O'Keefe
1996-09-10  0:00                   ` Mark A Biggar
1996-09-10  0:00                   ` Robert Dewar
1996-09-06  0:00               ` Robert A Duff
1996-09-10  0:00       ` Robert I. Eachus
1996-09-03  0:00     ` Peter Hermann
1996-09-04  0:00       ` Robert Dewar
1996-09-04  0:00         ` Larry Kilgallen
1996-09-04  0:00     ` Robert Dewar
1996-09-04  0:00     ` Robert Dewar
1996-09-03  0:00   ` Jon S Anthony
1996-09-04  0:00     ` David Weller
1996-09-04  0:00     ` Joel VanLaven
1996-09-04  0:00   ` Jon S Anthony
1996-09-04  0:00     ` Robert A Duff
1996-09-04  0:00   ` Jonas Nygren
1996-09-06  0:00     ` Tucker Taft
1996-09-08  0:00     ` Jon S Anthony
1996-09-08  0:00       ` Robert Dewar
1996-09-09  0:00         ` John G. Volan
1996-09-09  0:00     ` Jon S Anthony
1996-09-04  0:00   ` Jon S Anthony
1996-09-05  0:00     ` Robert A Duff
1996-09-05  0:00     ` Mark A Biggar
1996-09-05  0:00   ` Robert I. Eachus
1996-09-06  0:00   ` Jon S Anthony
1996-09-07  0:00   ` Jonas Nygren
1996-09-08  0:00   ` Jon S Anthony
1996-09-08  0:00     ` Robert A Duff
1996-09-08  0:00   ` Jon S Anthony
1996-09-01  0:00 ` Robert Dewar
1996-09-05  0:00 ` Jon S Anthony
1996-09-06  0:00 ` Jon S Anthony
1996-09-06  0:00 ` Jon S Anthony
1996-09-10  0:00 ` Norman H. Cohen
1996-09-10  0:00 ` Samuel Tardieu
1996-09-11  0:00 ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1996-09-06  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-09-04  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-09-06  0:00 ` Jon S Anthony
1996-09-04  0:00 Bob Mathis
1996-08-28  0:00 Two ideas for the next Ada standard Van Snyder
1996-08-29  0:00 ` Dale Stanbrough
1996-08-30  0:00   ` Robert A Duff
1996-08-30  0:00     ` Adam Beneschan
1996-08-31  0:00       ` Robert A Duff
1996-08-31  0:00         ` Robert Dewar
1996-09-04  0:00           ` Dennison
1996-09-05  0:00             ` Robert Dewar
1996-09-05  0:00               ` Dennison
1996-09-06  0:00                 ` Robert Dewar
1996-09-07  0:00                   ` Dennison
1996-09-07  0:00                     ` Robert Dewar
1996-09-06  0:00           ` Norman H. Cohen
1996-09-06  0:00             ` Robert A Duff
1996-09-06  0:00               ` Robert Dewar
1996-09-09  0:00               ` Norman H. Cohen
1996-09-06  0:00             ` Robert Dewar
1996-09-07  0:00             ` Keith Thompson
1996-09-12  0:00               ` Robert Dewar
1996-09-02  0:00         ` Geert Bosch
1996-09-02  0:00           ` Robert A Duff
1996-08-30  0:00 ` Peter Hermann
1996-08-30  0:00   ` Michael F Brenner
1996-08-30  0:00     ` Robert A Duff
1996-08-30  0:00       ` Robert Dewar
1996-08-31  0:00         ` Robert A Duff
1996-08-31  0:00           ` Robert Dewar
1996-09-01  0:00             ` Robert A Duff
1996-08-31  0:00   ` Robert Dewar
1996-09-01  0:00     ` Robert A Duff
1996-09-02  0:00 ` Laurent Guerby
1996-09-02  0:00   ` Robert Dewar
1996-09-03  0:00 ` Laurent Guerby
1996-09-03  0:00   ` Robert Dewar
1996-09-04  0:00     ` Adam Beneschan
1996-09-03  0:00 ` Laurent Guerby
1996-09-03  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