comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Alternative syntax for function definitions?
Date: Sat, 27 Oct 2012 11:50:39 +0200
Date: 2012-10-27T11:50:39+02:00	[thread overview]
Message-ID: <15jzdp62q6hdp$.1u7hck0evmz22.dlg@40tude.net> (raw)
In-Reply-To: op.wmtx2nxkule2fv@cardamome

On Sat, 27 Oct 2012 11:02:37 +0200, Yannick Duch�ne (Hibou57) wrote:

> Le Sat, 27 Oct 2012 10:37:11 +0200, Dmitry A. Kazakov  
> <mailbox@dmitry-kazakov.de> a �crit:
>> That is no problem. All types should have classes anyway. The dotted
>> notation itself is an implementation of some record interface.
> To talk about that point, I'm thinking of always using tagged types  
> instead of legacy records, so as to be able to hide or expose the type  
> definition without consequences on the client side, or even just change  
> the layout. That's more resilient: if you have three properties A, B, C,  
> where one is derived from the two other, say C is derived from A and B,  
> and then decide later that instead C will be stored and B derived from A  
> and C, you can do that without breaking client, if you use tagged records  
> (you can't with legacy record). But I expect generalisation of use of  
> tagged types to impact efficiency with most compilers (although I'm  
> actually using only one).

The problem is conflation of the interface and implementation. Ada 83
record types are both interface and implementation. Which is OK only in the
private part of the package. In public interfaces it is a fragile design
the language unfortunately encourages.

This separation has nothing to do with tagged types, classes and
inheritance. It has no impact on efficiency other that different
implementations of the same interface could perform differently.

People are confusing these issues all the time.

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



      parent reply	other threads:[~2012-10-27  9:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-27  6:30 Alternative syntax for function definitions? Yannick Duchêne (Hibou57)
2012-10-27  7:11 ` Dmitry A. Kazakov
2012-10-27  7:49   ` Yannick Duchêne (Hibou57)
2012-10-27  8:37     ` Dmitry A. Kazakov
2012-10-27  9:02       ` Yannick Duchêne (Hibou57)
2012-10-27  9:38         ` Bill Findlay
2012-10-27 11:13           ` Yannick Duchêne (Hibou57)
2012-10-27 23:46             ` Bill Findlay
2012-10-27  9:50         ` 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