comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: 'Class'Class'Class'Class ad libitum
Date: Tue, 13 Sep 2016 14:37:12 +0200
Date: 2016-09-13T14:37:12+02:00	[thread overview]
Message-ID: <nr8rv6$15n3$1@gioia.aioe.org> (raw)
In-Reply-To: nr8l8k$98g$2@dont-email.me

On 13/09/2016 12:43, Alejandro R. Mosteo wrote:
> I get why this is legal:
>
>    type X is tagged null record;
>
>    subtype Y is X'Class;
>
>    subtype Z is X'Class'Class'Class'Class;
>
> But can you think of any legitimate reason to use it besides obfuscation?

Only the latter is wrong. X'Class'Class cannot be same as X'Class.

X is a set of values with operations on X

X'Class is a set of values of X and values of all types derived from X

X'Class'Class should be a set of values of X'Class and values of all 
types derived from X'Class. We cannot derive from X'Class in Ada, so 
class of X'Class holds only X'Class. But that does not make them same. 
Like X is not same as X'Class even if there is no descendants of X. 
Class-wide operations of X would be primitive operations of X'Class'Class.

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


  parent reply	other threads:[~2016-09-13 12:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 10:43 'Class'Class'Class'Class ad libitum Alejandro R. Mosteo
2016-09-13 11:29 ` J-P. Rosen
2016-09-13 16:10   ` Alejandro R. Mosteo
2016-09-13 18:53   ` Robert A Duff
2016-09-13 12:37 ` Dmitry A. Kazakov [this message]
2016-09-13 16:10   ` Alejandro R. Mosteo
2016-09-13 16:34     ` Dmitry A. Kazakov
2016-09-13 16:54       ` Alejandro R. Mosteo
2016-09-13 18:41         ` 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