comp.lang.ada
 help / color / mirror / Atom feed
From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: Anybody in US using ADA ? One silly idea..
Date: Thu, 30 Jan 2003 12:58:27 -0500
Date: 2003-01-30T12:58:27-05:00	[thread overview]
Message-ID: <1043949507.331484@master.nyc.kbcfp.com> (raw)
In-Reply-To: <25ji3v8n915cnnnaqpjvm4f7i01a66r9pf@4ax.com>

Dmitry A. Kazakov wrote:
> Consider Unbounded_String, Bounded_String, String. Why one cannot be a
> subtype of another? In my view it is very reasonable, because all of
> them are in fact just different representation of the same concept of
> "array of characters". And a representation has to be no issue.

You see, that's exactly what I'm talking about. You get lost
because you're thinking about "concepts" instead of the nuts
and bolts of the string types themselves. Ada is not an OO
language in its entirety, and some of those strings are just
arrays, so you're not going to get subtyping in the way you
want. If there are operations common to all types, you should
be able to capture that in generics.

> No, it is an extension of OO and ADT. It is a simple consequence of
> the principle that interface and implementation have to be separated. 

I don't see that at all. You want language support for the
notion that if an object of type A can be converted to an
object of type B, and vice versa, than a function which
operates on one should automatically operate on the other
using convert-in/convert-out. I do not see at all what this
has to do with any of OO, ADT, or separation.

> This what you require by saying:
> class Circle : public Ellipse.
> namely that Circle is convertible to Ellipse and back.

No one else thinks that this is what A : B means, though.
You would be better off if you stopped trying to overload
everyone's understanding of inheritance with a new concept
that no one associates with that.

> C++ does not allow me to define my own type relations.

Well, not for convert-in/convert-out, but plenty else.
To do what you want, you can do

struct A
{
     struct BehaveLikeB : B
     {
         A &object;
         BehaveLikeB(A &o) : object(o) { }
         // Implement B methods, affecting A object
     };
     BehaveLikeB likeB;
     A() : likeB(*this) { }
     B &asB() { return likeB; }
};

void foo(B &);
A anA;
foo(anA.asB());

> define "-": NN x NN -> NN in a most reasonable way.

Oh, sorry about that. For some reason my brain was saying
unary minus, not subtraction. Yes, for subtraction throwing
a constraint error is the way to go.

> This could be an option if the software were never modified. In the
> real world you would like to have as much compile-time checks as
> possible, even for errors which will never occur in the given version
> of the program. You never know in which direction the code will
> evolve. And there is no better mechanism for compile-time checks than
> the type system.

But the template system gives you complete type safety,
and compile-time checks! If you modify the code to use
an unavailable operation, the compiler will tell you.
All your method does is add an additional set of things
that the types must be able to do even though the code
doesn't need those operations. It is no more future-
proof than the template version, because you do not know
for sure that you will never need to add methods to the
interface.




  reply	other threads:[~2003-01-30 17:58 UTC|newest]

Thread overview: 341+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-31 18:37 Anybody in US using ADA ? Mr Bill
2002-12-31 18:55 ` John R. Strohm
2003-01-01  3:20   ` Marin David Condic
2003-01-01  7:11     ` tmoran
2003-01-01 14:31       ` Marin David Condic
2003-01-01 22:49         ` tmoran
2003-01-02 12:45           ` Marin David Condic
2003-01-02 18:08             ` Anybody in US using ADA ? New language competition? Warren W. Gay VE3WWG
2003-01-03  2:47               ` Marin David Condic
2003-01-03  6:01                 ` Robert C. Leif
2003-01-03 17:58                 ` Anybody in US using ADA ? New language competition? (long) Warren W. Gay VE3WWG
2003-01-04 14:57                   ` Marin David Condic
2003-01-06 15:53                     ` Wes Groleau
2003-01-06 16:36                       ` Larry Kilgallen
2003-01-06 20:47                       ` Randy Brukardt
2003-01-07 13:15                         ` Wes Groleau
2003-01-07 19:05                           ` Randy Brukardt
2003-01-07 19:37                             ` Larry Kilgallen
2003-01-07 20:52                             ` Wes Groleau
2003-01-08 20:05                               ` Randy Brukardt
2003-01-07 21:23                             ` Georg Bauhaus
2003-01-08  0:30                             ` Richard Riehle
2003-01-08 20:12                               ` Randy Brukardt
2003-01-07 13:11                       ` Marin David Condic
2003-01-06 18:22                     ` Warren W. Gay VE3WWG
2003-01-06 20:52                       ` Randy Brukardt
2003-01-07 13:56                         ` Marin David Condic
2003-01-07 19:15                           ` Randy Brukardt
2003-01-08 13:14                             ` Marin David Condic
2003-01-08 18:04                               ` tmoran
2003-01-08 18:05                               ` Warren W. Gay VE3WWG
2003-01-08 20:20                                 ` Larry Kilgallen
2003-01-09 13:21                                 ` Marin David Condic
2003-01-08 20:24                               ` Randy Brukardt
2003-01-09 13:34                                 ` Marin David Condic
2003-01-07 13:50                       ` Marin David Condic
2003-01-07 17:48                         ` Warren W. Gay VE3WWG
2003-01-08 13:34                           ` Marin David Condic
2003-01-08 18:04                             ` tmoran
2003-01-08 18:16                             ` Warren W. Gay VE3WWG
2003-01-09 13:22                         ` chris.danx
2003-01-09 13:53                           ` Marin David Condic
2003-01-09 15:09                           ` Raster graphics [was Anybody in US using ADA ? New language competition? (long)] Chad R. Meiners
2003-01-11 19:23                             ` chris.danx
2003-01-03  9:57             ` Anybody in US using ADA ? Kevin Cline
2003-01-03 12:37               ` Marin David Condic
2003-01-03 15:32                 ` Anybody in US using ADA ? | for interrest Mark
2003-01-09  0:59                 ` Anybody in US using ADA ? faust
2003-01-08 12:53                   ` Marin David Condic
2003-01-05 17:04           ` Adrian Hoe
2003-01-06 20:06             ` Randy Brukardt
2003-01-07  2:07             ` Jeffrey Creem
2003-01-07  3:22               ` Jeffrey Creem
2003-01-05 17:06         ` Adrian Hoe
2003-01-02  3:05       ` faust
2003-01-02  3:07       ` faust
2003-01-02 22:09       ` Robert C. Leif
2003-01-02 17:57     ` Anybody in US using ADA ? One silly idea Warren W. Gay VE3WWG
2003-01-02 18:29       ` Vinzent Hoefler
2003-01-02 22:02         ` Warren W. Gay VE3WWG
2003-01-02 20:36       ` Bill Findlay
     [not found]         ` <ujn2va.go3.ln@beastie.ix.netcom.com>
2003-01-03  1:44           ` Bill Findlay
2003-01-09  2:21           ` faust
2003-01-03  2:56         ` Marin David Condic
2003-01-03  4:11           ` sk
2003-01-03  4:43           ` Bill Findlay
2003-01-03  6:01             ` Robert C. Leif
2003-01-07 17:47               ` Kevin Cline
2003-01-07 19:49                 ` tmoran
2003-01-09  5:15                   ` Kevin Cline
2003-01-03 13:16             ` Marin David Condic
2003-01-03 18:28               ` Bill Findlay
2003-01-04 15:17                 ` Marin David Condic
2003-01-09 16:36                 ` faust
     [not found]                   ` <roliva.8b4.ln@beastie.ix.netcom.com>
2003-01-09  4:32                     ` Hyman Rosen
2003-01-03 20:07               ` tmoran
2003-01-03 23:06                 ` Martin Dowie
2003-01-09 16:22                   ` faust
2003-01-04  7:07                 ` Robert C. Leif
2003-01-04 17:49                   ` Steve
2003-01-05  3:07                     ` Robert C. Leif
2003-01-07 12:38               ` Richard Riehle
2003-01-09 16:36                 ` faust
2003-01-09 16:37                 ` Harness your own creativity to Ada (Re: Anybody in US using ADA ? One silly idea..) faust
2003-01-03  9:24         ` Anybody in US using ADA ? One silly idea Kevin Cline
2003-01-03 10:11           ` John R. Strohm
2003-01-03 13:23             ` Marin David Condic
2003-01-03 18:40               ` John R. Strohm
2003-01-04  9:05                 ` Kevin Cline
2003-01-04 16:34                   ` John R. Strohm
2003-01-03 19:40             ` Kevin Cline
2003-01-03 22:34           ` Ted Dennison
2003-01-04  8:53             ` Kevin Cline
2003-01-04 11:48               ` Dmitry A. Kazakov
2003-01-04 18:15                 ` Robert A Duff
2003-01-04 20:18                 ` Hillel Y. Sims
2003-01-05 14:13                   ` Dmitry A. Kazakov
2003-01-05 15:45                     ` James S. Rogers
2003-01-06 14:13                       ` Dmitry A. Kazakov
2003-01-06  1:20                     ` Hillel Y. Sims
2003-01-06 14:14                       ` Dmitry A. Kazakov
2003-01-06 19:07                         ` Randy Brukardt
2003-01-07 12:33                           ` Dmitry A. Kazakov
2003-01-08  4:24                             ` Hyman Rosen
2003-01-08 13:55                               ` Dmitry A. Kazakov
2003-01-08 18:43                                 ` Wes Groleau
2003-01-08 21:54                                 ` Ted Dennison
2003-01-09  5:05                                 ` Hyman Rosen
2003-01-06  1:37                     ` Robert C. Leif
2003-01-06 14:13                       ` Dmitry A. Kazakov
2003-01-06 19:13                         ` Pascal Obry
2003-01-07 12:02                           ` Dmitry A. Kazakov
2003-01-07  3:00                         ` Hyman Rosen
2003-01-07 12:10                           ` Dmitry A. Kazakov
2003-01-08  3:41                             ` Hyman Rosen
2003-01-08 13:19                               ` Dmitry A. Kazakov
2003-01-09  4:23                                 ` Hyman Rosen
2003-01-10 13:51                                   ` Dmitry A. Kazakov
2003-01-13 17:05                                     ` Hyman Rosen
2003-01-15 17:04                                       ` Dmitry A. Kazakov
2003-01-15 17:23                                         ` Hyman Rosen
2003-01-15 18:19                                           ` Bill Findlay
2003-01-15 19:02                                             ` Hyman Rosen
2003-01-15 19:11                                               ` Bill Findlay
2003-01-15 22:51                                                 ` chris.danx
2003-01-15 23:39                                                   ` Bill Findlay
2003-01-15 23:57                                                     ` chris.danx
2003-01-16  0:32                                                       ` Bill Findlay
2003-01-16  5:23                                                         ` Richard Riehle
2003-01-16 16:33                                                           ` One sillier idea Wes Groleau
2003-01-16 17:17                                                             ` sk
2003-01-16 17:11                                                           ` Anybody in US using ADA ? One silly idea Hyman Rosen
2003-01-16 17:50                                                             ` Richard Riehle
2003-01-16 17:57                                                             ` Frank J. Lhota
2003-01-16 18:26                                                               ` Wes Groleau
2003-01-17  8:27                                                                 ` Anders Wirzenius
     [not found]                                                                 ` <h0770b.5e3.ln@beastie.ix.netcom.com>
2003-01-17 17:32                                                                   ` Warren W. Gay VE3WWG
2003-01-17 17:31                                                               ` Warren W. Gay VE3WWG
2003-01-16  0:19                                             ` Richard Riehle
2003-01-16  0:16                                               ` chris.danx
2003-01-16  0:46                                                 ` Bill Findlay
2003-01-16  1:19                                                 ` Jeffrey Carter
2003-01-16  2:44                                                 ` Richard Riehle
2003-01-16  0:24                                               ` Bill Findlay
2003-01-16 10:34                                                 ` Jean-Pierre Rosen
2003-01-16 18:20                                           ` Dmitry A. Kazakov
2003-01-16 18:59                                             ` Hyman Rosen
2003-01-17  4:09                                               ` Richard Riehle
2003-01-17 14:36                                                 ` Hyman Rosen
2003-01-17 16:28                                               ` Dmitry A. Kazakov
2003-01-17 17:23                                                 ` Hyman Rosen
2003-01-17 19:02                                                   ` Richard Riehle
2003-01-17 20:02                                                     ` Hyman Rosen
2003-01-25  1:40                                                       ` Richard Riehle
2003-01-26  4:57                                                         ` Hyman Rosen
2003-01-18 12:31                                                   ` Dmitry A. Kazakov
2003-01-18 22:53                                                     ` Hillel Y. Sims
2003-01-19  6:18                                                       ` Kevin Cline
2003-01-19 12:34                                                       ` Dmitry A. Kazakov
2003-01-21  2:10                                                         ` Hillel Y. Sims
2003-01-21  9:25                                                           ` Dmitry A. Kazakov
2003-01-21 18:55                                                             ` Kevin Cline
2003-01-23 11:00                                                               ` Dmitry A. Kazakov
2003-01-23 16:27                                                                 ` Hyman Rosen
2003-01-25 11:53                                                                   ` Dmitry A. Kazakov
2003-01-26  6:32                                                                     ` Hyman Rosen
2003-01-27 10:11                                                                       ` Dmitry A. Kazakov
2003-01-27 15:08                                                                         ` Hyman Rosen
2003-01-28  8:27                                                                           ` Dmitry A. Kazakov
2003-01-28 15:48                                                                             ` Kevin Cline
2003-01-28 16:29                                                                               ` Dmitry A. Kazakov
2003-01-28 17:14                                                                                 ` Hyman Rosen
2003-01-29  8:28                                                                                   ` Dmitry A. Kazakov
2003-01-28 17:11                                                                             ` Hyman Rosen
2003-01-29  8:37                                                                               ` Dmitry A. Kazakov
2003-01-29 15:44                                                                                 ` Hyman Rosen
2003-01-29 21:34                                                                                   ` Mark Biggar
2003-01-29 22:54                                                                                     ` Hyman Rosen
2003-01-30  9:03                                                                                       ` Dmitry A. Kazakov
2003-01-30 14:59                                                                                         ` Hyman Rosen
2003-01-30 16:32                                                                                           ` Dmitry A. Kazakov
2003-01-30 17:58                                                                                             ` Hyman Rosen [this message]
2003-01-31  8:31                                                                                               ` Dmitry A. Kazakov
2003-01-31 15:02                                                                                                 ` Hyman Rosen
2003-01-31 16:12                                                                                                   ` Dmitry A. Kazakov
2003-01-31 17:11                                                                                                     ` Hyman Rosen
2003-02-03  9:59                                                                                                       ` Dmitry A. Kazakov
2003-02-03 13:26                                                                                                         ` Hyman Rosen
2003-02-03 16:12                                                                                                           ` Dmitry A. Kazakov
2003-02-03 17:00                                                                                                             ` Hyman Rosen
2003-02-04  9:54                                                                                                               ` Dmitry A. Kazakov
2003-02-04 14:50                                                                                                                 ` Colin Paul Gloster
2003-02-04 15:56                                                                                                                 ` Hyman Rosen
2003-02-05 12:53                                                                                                                   ` Dmitry A. Kazakov
2003-02-05 15:22                                                                                                                     ` Hyman Rosen
2003-02-05  7:02                                                                                                                 ` Amir Yantimirov
     [not found]                                                                                                             ` <en04h-1k4.ln1@beastie.ix.netcom.com>
2003-02-04  9:48                                                                                                               ` Dmitry A. Kazakov
2003-02-04 10:10                                                                                                             ` Colin Paul Gloster
2003-02-04 13:12                                                                                                               ` Dmitry A. Kazakov
2003-02-04 14:33                                                                                                                 ` Colin Paul Gloster
2003-02-04 15:22                                                                                                                   ` Dmitry A. Kazakov
2003-02-04 16:47                                                                                                                     ` Hyman Rosen
2003-02-04 15:10                                                                                                                 ` Hyman Rosen
2003-02-05 12:53                                                                                                                   ` Dmitry A. Kazakov
2003-02-05 15:35                                                                                                                     ` Hyman Rosen
2003-02-04  7:04                                                                                                     ` AG
2003-02-03 12:34                                                                                                       ` Dmitry A. Kazakov
2003-02-05  4:38                                                                                                         ` AG
2003-02-04 10:08                                                                                                           ` Dmitry A. Kazakov
2003-01-30  8:09                                                                                   ` Dmitry A. Kazakov
2003-01-30 15:01                                                                                     ` Hyman Rosen
2003-01-30 16:33                                                                                       ` Dmitry A. Kazakov
2003-01-30 17:12                                                                                         ` Stephen Leake
2003-01-31  8:51                                                                                           ` Dmitry A. Kazakov
2003-01-31 15:04                                                                                             ` Hyman Rosen
2003-01-30 18:01                                                                                         ` Hyman Rosen
2003-01-31  8:38                                                                                           ` Dmitry A. Kazakov
2003-01-31 15:11                                                                                             ` Hyman Rosen
2003-01-31 16:27                                                                                               ` Dmitry A. Kazakov
2003-01-31 17:25                                                                                                 ` Hyman Rosen
2003-02-03  9:59                                                                                                   ` Dmitry A. Kazakov
2003-02-03 13:11                                                                                                     ` Hyman Rosen
2003-02-03 14:40                                                                                                       ` Hyman Rosen
2003-02-04 10:11                                                                                                         ` Dmitry A. Kazakov
2003-02-04  6:34                                                                                                 ` AG
2003-02-03 12:58                                                                                                   ` Dmitry A. Kazakov
2003-01-27 16:04                                                                 ` Kevin Cline
2003-01-19  3:42                                                     ` Hyman Rosen
2003-01-19 12:34                                                       ` Dmitry A. Kazakov
2003-01-19 14:13                                                         ` Hyman Rosen
2003-01-20  8:43                                                           ` Dmitry A. Kazakov
2003-01-23 13:15                                                     ` please, please, please, Wes Groleau
2003-01-16 19:08                                             ` Anybody in US using ADA ? One silly idea Hyman Rosen
2003-01-17 16:28                                               ` Dmitry A. Kazakov
2003-01-17  4:03                                             ` Richard Riehle
2003-01-17 16:28                                               ` Dmitry A. Kazakov
2003-01-21  5:53                                                 ` Richard Riehle
2003-01-21  6:24                                                   ` tmoran
2003-01-16 19:09                                           ` Larry Kilgallen
2003-01-15 22:48                                         ` Robert A Duff
2003-01-16 18:20                                           ` Dmitry A. Kazakov
2003-01-25 16:05                                         ` Robert I. Eachus
2003-01-25 20:33                                           ` Richard Riehle
2003-01-27 13:29                                           ` Wes Groleau
2003-01-27 16:29                                           ` Hyman Rosen
2003-01-28 13:24                                             ` Robert A Duff
2003-01-28 17:16                                               ` Hyman Rosen
2003-01-28 18:44                                             ` Robert A Duff
2003-01-28 20:04                                               ` Hyman Rosen
2003-01-07 13:51                         ` Richard Riehle
2003-01-08  3:51                           ` Hyman Rosen
2003-01-06 16:33                       ` Georg Bauhaus
2003-01-06 16:23                     ` Wes Groleau
2003-01-06  4:20                 ` Kevin Cline
2003-01-06 14:16                   ` Dmitry A. Kazakov
2003-01-06 16:08                   ` Wes Groleau
2003-01-06 17:26                     ` James S. Rogers
2003-01-07 13:36                       ` Wes Groleau
2003-01-07 18:40                       ` David C. Hoos
2003-01-07 21:29                         ` James S. Rogers
2003-01-07  3:14                     ` Hyman Rosen
2003-01-07 13:40                       ` Wes Groleau
2003-01-08  4:30                         ` Hyman Rosen
2003-01-04 18:04               ` Ted Dennison
2003-01-04 20:20                 ` Hillel Y. Sims
2003-01-05  2:47                   ` Ted Dennison
2003-01-05 23:58                     ` [OT] Mozilla filtering " chris.danx
2003-01-06  4:12                       ` Ted Dennison
2003-01-06 16:54                         ` chris.danx
2003-01-06 16:31                     ` [off-topic] spam-filters Wes Groleau
2003-01-06 19:23                       ` Randy Brukardt
2003-01-07  2:59                         ` Ted Dennison
2003-01-07 18:49                           ` Randy Brukardt
2003-01-07 20:38                             ` tmoran
2003-01-07 21:01                             ` Wes Groleau
2003-01-07  1:19                       ` Ted Dennison
2003-01-07 13:46                         ` Wes Groleau
2003-01-09 16:24                     ` Anybody in US using ADA ? One silly idea faust
2003-01-09 15:04                       ` Ted Dennison
2003-01-10 14:23                         ` faust
2003-01-11  5:44                           ` Ted Dennison
2003-01-11  5:48                             ` Ted Dennison
2003-01-06  4:39                 ` Kevin Cline
2003-01-06  9:49                   ` Ted Dennison
2003-01-03  0:07       ` Robert C. Leif
2003-01-03  2:51       ` Marin David Condic
2003-01-03 18:13         ` Warren W. Gay VE3WWG
2003-01-04 15:30           ` Marin David Condic
2003-01-07 12:58         ` Richard Riehle
2003-01-08 19:46       ` Remarketing the language ( was Re: ....ADA ? One silly idea..) faust
2003-01-08 18:24         ` Warren W. Gay VE3WWG
2003-01-08 18:42           ` Edi Weitz
2003-01-09 16:30           ` faust
2003-01-10  7:00             ` Fraser Wilson
2003-01-10  8:06               ` Geoffrey Summerhayes
2003-01-10 10:17                 ` Fraser Wilson
2003-01-02 18:29     ` Anybody in US using ADA ? Mike Silva
2003-01-03  0:41       ` David Emery
2003-01-03  6:44         ` Mike Silva
2003-01-03 10:16           ` John R. Strohm
2003-01-03 20:02             ` Mike Silva
2003-01-03 22:16               ` John R. Strohm
2003-01-04  8:31                 ` Mike Silva
2003-01-06 22:24   ` Richard Riehle
2003-01-06 23:45     ` Jerry van Dijk
2003-01-07 18:35     ` Mike Silva
2003-01-07 20:34       ` Jerry Petrey
2003-01-07 21:07         ` Dead Fred the Head Red
2003-01-09  2:14     ` faust
2003-01-09  2:15     ` C++ , ADA and the Joint Strike Fighter ( was Re: Anybody in US using ADA ?) faust
2003-01-08 13:21       ` Ted Dennison
2003-01-08 13:51         ` C++ , ADA and the Joint Strike Fighter ( was Re: Anybody in USusing " Marin David Condic
2003-01-08 21:42           ` Ted Dennison
2003-01-09 16:27           ` faust
2003-01-08 21:44             ` C++ , ADA and the Joint Strike Fighter Vinzent Hoefler
2003-01-10  7:58               ` faust
2003-01-09 14:34                 ` Vinzent Hoefler
2003-01-09 14:57                   ` C++ , ADA and the Joint Strike Fighter (Off-topic) Larry Kilgallen
2003-01-09 17:10                   ` C++ , ADA and the Joint Strike Fighter Pascal Obry
2003-01-10 14:18                   ` faust
2003-01-09 19:29                     ` C++ , ADA and the Joint Strike Fighter (Off-topic) Larry Kilgallen
2003-01-11 19:31                       ` chris.danx
2003-01-12 22:22                         ` u.r. faust
2003-01-12  9:07                           ` tmoran
2003-01-13  4:20                             ` u.r. faust
2003-01-13 13:25                           ` Marin David Condic
2003-01-11 22:10                     ` Larry Kilgallen
     [not found]                     ` <H01kDjtzy1$7@eisneOrganization: LJK Software <oK$dhQDJBSHL@eisner.encompasserve.org>
2003-01-12 22:23                       ` u.r. faust
2003-01-09 12:34             ` C++ , ADA and the Joint Strike Fighter ( was Re: Anybody in USusing ADA ?) Marin David Condic
2002-12-31 22:38 ` Anybody in US using ADA ? Britt Snodgrass
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03  1:18 Anybody in US using ADA ? One silly idea Alexandre E. Kopilovitch
2003-01-16 11:10 Grein, Christoph
2003-01-16 16:13 ` Stephen Leake
2003-01-16 16:53 ` Victor Porton
2003-01-17  6:08 Grein, Christoph
2003-02-03 10:13 Grein, Christoph
2003-02-05  5:44 ` AG
2003-02-04 16:05   ` Chad R. Meiners
2003-02-04  9:13 Grein, Christoph
2003-02-05  6:50 ` AG
2003-02-04 13:26   ` Dmitry A. Kazakov
replies disabled

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