comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Why can't Ada use dot notation on private types?
Date: Thu, 9 Feb 2017 09:47:38 +0100
Date: 2017-02-09T09:47:38+01:00	[thread overview]
Message-ID: <o7haba$50o$1@gioia.aioe.org> (raw)
In-Reply-To: o7g9fe$q23$1@franka.jacob-sparre.dk

On 09/02/2017 00:26, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:o7am71$13o1$1@gioia.aioe.org...
>> On 2017-02-06 20:44, Randy Brukardt wrote:
>>
>>> The problems mainly come from the possibility of implicit .all and
>>> 'Access.
>>
>> Perfect, why is this a problem? It is just what is needed. I want to
>> override "all", so let me do this.
>
> When elementary types are included in prefix notation, there are potentially
> an infinite number of implicit .all or 'Access combinations. A compiler
> would have trouble figuring them out (aand it could get *very* expensive),
> and a reader would be even more confused.

".all" and "'Access" have an argument and a result. It is a classic MD 
case. Upon overriding it must be clear that this happens for a given 
type of the argument (e.g. object type) and a given type of the result 
(e.g. access type). The compiler can select an implementation in a usual 
manner and then look if that one has been overridden in the given context.

Actual problems are with tagged types, because full MD is not supported. 
But that is nothing new. User-defined assignment is also a MD operation 
and Ada's 95 controlled-types kludge does not work right for it either.

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

  reply	other threads:[~2017-02-09  8:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-05 14:17 Why can't Ada use dot notation on private types? Lucretia
2017-02-05 15:31 ` Dmitry A. Kazakov
2017-02-06 19:44   ` Randy Brukardt
2017-02-06 20:27     ` Dmitry A. Kazakov
2017-02-08 23:26       ` Randy Brukardt
2017-02-09  8:47         ` Dmitry A. Kazakov [this message]
2017-02-06 19:40 ` Randy Brukardt
replies disabled

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