comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: 'Protected' abstract subprograms
Date: Sun, 12 Jan 2014 11:22:19 +0100
Date: 2014-01-12T11:22:19+01:00	[thread overview]
Message-ID: <okl0bsxunhyt.10j08x3p05joo.dlg@40tude.net> (raw)
In-Reply-To: bjf514FdonuU1@mid.individual.net

On Sun, 12 Jan 2014 11:19:41 +0200, Niklas Holsti wrote:

> (I said I wouldn't, but here I go...)
> 
> On 14-01-11 21:35 , Dmitry A. Kazakov wrote:
>> On Sat, 11 Jan 2014 15:42:39 +0200, Niklas Holsti wrote:
>> 
>>>> * When you dispatch in a body of an operation that means that the body is
>>>> valid for more than one type. Many types = class. Operation for all class =
>>>> class-wide operation.
>>>
>>> Yes, but "many types" is not the same as "all class".
>> 
>> Per design pattern it is all class. Anyway, it is certainly not the
>> singleton type specified in the pattern, because that is type is abstract.
>> 
>> But of course, if you want to propose changes in the language which would
>> allow specification of narrower subclasses for such cases, it would be most
>> welcome.
> 
> As I see it, it is you who are proposing a change: you say that
> redispatch should never be used, so you are proposing a reduced Ada
> language which does not *have* redispatch.

Firstly, when I say that re-dispatch should not be used, that is not same
as proposing to remove it = technically, to disallow view conversions in
the bodies of primitive operations. Though if you asked, yes I would do
that, providing Unchecked_Class instead.

Secondly, it is not reduced. On the contrary, if you want to be able to
re-dispatch then you must reduce the language by limiting dispatching
operation to strictly by-reference types and then reduce these types to
certain representations that would contain the parent's type
representation. It is a very serious and quite non-Ada constraint as it
meddles with representations.

Thirdly, I merely pointed out that if we agreed that re-dispatch refers to
a class, which in your opinion cannot be spelt in the language, then,
logically, you should, if you wanted to keep re-dispatch, change the
language so that this class could be properly specified. Of course,
carefully observing the result of such an extension, you could note that it
would not be re-dispatch anymore because the operation in question would
now act on some class rather than a specific type. Well, that is the point.
Re-dispatch is fundamentally wrong, which does not mean that the
functionality is wrong. You can keep the functionality, but not spell it as
re-dispatch.

>>>> Re-dispatch breaks this model and effectively makes your design
>>>> un/weakly typed.
>>>
>>> I don't agree, because my conceptual "model" is different. Your model is
>>> stronger (more specific) than mine, which paradoxically means that it is
>>> easier to break :-)
>> 
>> Wouldn't that be arguing against strong typing?
> 
> Your concept of classes and types is stronger (more specific and
> limiting) than what Ada provides -- in effect,

I used nothing but class = set of types (a closure of, being precise). How
is it stronger than Ada's concept of class/type? I thought it was the
concept Ada deployed.

> you have certain design
> rules which limit you to an Ada subset without redispatch.

merely strongly typing. Compare it to Unchecked_Conversion and argue
against the design rule to avoid Unchecked_Conversion.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

      reply	other threads:[~2014-01-12 10:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 22:00 'Protected' abstract subprograms sbelmont700
2014-01-10 22:30 ` Randy Brukardt
2014-01-11 16:12   ` sbelmont700
2014-01-14  3:45     ` Randy Brukardt
2014-01-14  9:05       ` Dmitry A. Kazakov
2014-01-15  0:36         ` Randy Brukardt
2014-01-15  9:17           ` Dmitry A. Kazakov
2014-01-15 14:11             ` Robert A Duff
2014-01-15 15:40               ` adambeneschan
2014-01-15 21:21                 ` Robert A Duff
2014-01-15 23:10                   ` Randy Brukardt
2014-01-16  0:51                     ` Robert A Duff
2014-01-16 10:43                       ` AdaMagica
2014-01-16 16:32                         ` adambeneschan
2014-01-17  1:49                         ` Robert A Duff
2014-01-17 23:23                           ` Randy Brukardt
2014-01-19 21:07                             ` Robert A Duff
2014-01-20  8:40                               ` Dmitry A. Kazakov
2014-01-21 14:37                                 ` Robert A Duff
2014-01-22  8:27                                   ` Dmitry A. Kazakov
2014-01-21  1:21                               ` Randy Brukardt
2014-01-21 14:35                                 ` Robert A Duff
2014-01-15 23:17               ` Randy Brukardt
2014-01-16  8:52               ` Dmitry A. Kazakov
2014-01-11  8:41 ` J-P. Rosen
2014-01-11  8:59 ` Dmitry A. Kazakov
2014-01-11 13:42   ` Niklas Holsti
2014-01-11 19:35     ` Dmitry A. Kazakov
2014-01-12  9:19       ` Niklas Holsti
2014-01-12 10:22         ` Dmitry A. Kazakov [this message]
replies disabled

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