comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada design bug or GNAT bug?
Date: Mon, 6 Jul 2015 15:05:24 -0500
Date: 2015-07-06T15:05:24-05:00	[thread overview]
Message-ID: <mnen24$hha$1@loke.gir.dk> (raw)
In-Reply-To: 701370ff-559b-458f-a107-793095a15749@googlegroups.com

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

"Vincent" <vincent.diemunsch@gmail.com> wrote in message 
news:701370ff-559b-458f-a107-793095a15749@googlegroups.com...
>Le vendredi 3 juillet 2015 02:04:50 UTC+2, Randy Brukardt a écrit :
>
>> This seems to me to be nonsense. There's no need to use access types in 
>> Ada
>> OOP interfaces; "in out T" and "access T" have virtually the same 
>> semantics
>> when T is a tagged type. (Claw only has one access type in its entire
>> interface, used for a return type that ought to be by reference. 
>> Everything
>> else does not use visible access types.) It's more work this way, but 
>> it's
>> definitely possible.
>
>Yes it is possible, but it is more work, since one has to encapsulate the 
>access
>type into a "handle object".

Access type? It depends on the problem, of course, but 90% of OOP objects 
need no access type, named that or anything else (handle, cursor, etc.). If 
you think you need one (of *any* sort), you probably are still confused by 
the C++/Java model. Claw (windowing interface for Windows) doesn't expose 
handles of any sort for windows and most of the other object types (I would 
have said all, but I'd don't recall the exact way the menus work). It only 
exposes objects of various types (windows/controls, canvases, menus, etc.)

>The pity is that this work is not done by the compiler, through a proper 
>language
>defined mecanism. (This is what I think of when I speak of a "class type").

Well, there's little point for there to be a language-defined mechanism for 
something that you don't even need. In addition, if one properly defines 
their OOP without using access types, then one can use the indefinite 
containers to provide handles in the event that some are needed. That's much 
better than raw access types, as memory management and (usually) dangling 
handle checking is included for free.

>And even if you and I call it nonsense to use access types everywhere in 
>case of
>polymorphism, many textbooks present it as the normal Ada way of Advanced 
>OOP.

Many textbooks? There aren't "many textbooks" for Ada in the first place. I 
only know of a handful that discuss Ada OOP.

> Therefore, I maintain that the "tagged type" concept of Ada 95 was, at 
> least,
> incomplete, not to say awkward.

Therefore, I maintain that you're still confused about how to use Ada OOP. 
That's OK, lots of others are as well. :-)

                                Randy.


  reply	other threads:[~2015-07-06 20:05 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20 18:55 Ada design bug or GNAT bug? Dmitry A. Kazakov
2015-06-21  2:42 ` Randy Brukardt
2015-06-21  6:47   ` Dmitry A. Kazakov
2015-06-22 17:39     ` Randy Brukardt
2015-06-22 18:16       ` Dmitry A. Kazakov
2015-06-23 11:00         ` G.B.
2015-06-23 14:27           ` Dmitry A. Kazakov
2015-06-23 11:45         ` G.B.
2015-06-23 14:30           ` Dmitry A. Kazakov
2015-07-02 22:22         ` Randy Brukardt
2015-07-03  8:02           ` Dmitry A. Kazakov
2015-07-03 17:33             ` Randy Brukardt
2015-07-03 21:34               ` Dmitry A. Kazakov
2015-07-04  3:11                 ` Randy Brukardt
2015-07-04 12:14                   ` Dmitry A. Kazakov
2015-07-05  0:53                     ` Randy Brukardt
2015-06-22 18:27       ` Shark8
2015-06-23 11:51         ` vincent.diemunsch
2015-06-23 19:55           ` Shark8
2015-06-23 13:06         ` vincent.diemunsch
2015-06-23 14:30           ` David Botton
2015-06-23 15:57             ` Niklas Holsti
2015-06-23 16:01               ` G.B.
2015-06-23 18:05               ` David Botton
2015-06-23 19:38               ` David Botton
2015-06-23 14:38           ` Dmitry A. Kazakov
2015-06-23 16:57             ` Vincent
2015-06-23 17:15               ` Dmitry A. Kazakov
2015-06-23 19:14                 ` vincent.diemunsch
2015-06-23 19:33                   ` Dmitry A. Kazakov
2015-06-23 17:42           ` Jeffrey R. Carter
2015-07-02 22:06           ` Randy Brukardt
2015-07-04  1:52             ` Shark8
2015-07-04  3:24               ` Randy Brukardt
2015-07-04 11:02                 ` Build-in-place semantics? (Was: Ada design bug or GNAT bug?) Jacob Sparre Andersen
2015-07-04 12:15                   ` Dmitry A. Kazakov
2015-07-05  0:45                     ` Randy Brukardt
2015-07-05  7:10                       ` Dmitry A. Kazakov
2015-07-05  0:40                   ` Randy Brukardt
2015-07-04 14:05                 ` Ada design bug or GNAT bug? Bob Duff
2015-07-04  7:46               ` Simon Wright
2015-07-04 12:00                 ` Björn Lundin
2015-07-05  0:48                   ` Randy Brukardt
2015-07-06 12:37             ` Vincent
2015-07-06 20:05               ` Randy Brukardt [this message]
2015-07-07  8:06               ` 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