comp.lang.ada
 help / color / mirror / Atom feed
From: Mehdi Saada <00120260a@gmail.com>
Subject: Re: troubles learning OOP: expected type "Parent.Some_Child", found type Parent'Class
Date: Tue, 13 Feb 2018 04:03:21 -0800 (PST)
Date: 2018-02-13T04:03:21-08:00	[thread overview]
Message-ID: <3a5bb7ad-c07d-4fab-960a-6c605b9a7c6f@googlegroups.com> (raw)
In-Reply-To: <lyinb1ku26.fsf@pushface.org>

I understand, but I can't change the structure that much. I would have to rewrite x packages. Better stick with my solution... It seems sound.
For the aliased thing, I forgot and did that:
EMPILER (PILE, new T_Token_Operateur'(To_Token (TAMPON_PRIORITE.L_Operateur)));
Access to constant means access to a value that is constant, not only to things declared on the stack like A: constant INTEGER := 5. I can still use the heap. I nearly forgot that. Though it's less consistent that I would have liked.

At last it COMPILES without fault.
One last warning:
PILE_PRIORITE : P_PILE_2.T_Pile(50); is initiliazed, and the component that is refered to before calling on "PUSH", HEIGTH has a default value:

T_ELEME is private;
type T_Pile (Le_Max : T_Max) is limited private;
private
type T_Pile (Le_Max : T_Max) is record
    HEIGTH : T_Max := 0; -- en fait entre 0..LE_MAX
    V      : T_Vect (1..Le_Max);
end record;

Can't it see that HEIGTH will never be read uninitialized ?
for I in 1 .. Hauteur (PILE_PRIORITE) loop

  reply	other threads:[~2018-02-13 12:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 16:29 troubles learning OOP: expected type "Parent.Some_Child", found type Parent'Class Mehdi Saada
2018-02-12 17:44 ` Jeffrey R. Carter
2018-02-12 18:17   ` Mehdi Saada
2018-02-12 18:24     ` Dmitry A. Kazakov
2018-02-12 18:42       ` Simon Wright
2018-02-12 20:25     ` Jeffrey R. Carter
2018-02-12 21:18       ` Mehdi Saada
2018-02-12 22:40         ` Simon Wright
2018-02-12 23:12           ` Mehdi Saada
2018-02-13  8:00         ` Stephen Leake
2018-02-13 17:42         ` Jeffrey R. Carter
2018-02-13 17:56           ` Dmitry A. Kazakov
2018-02-12 21:19       ` Mehdi Saada
2018-02-12 18:40   ` Simon Wright
2018-02-12 21:39 ` Mehdi Saada
2018-02-12 21:43 ` Mehdi Saada
2018-02-12 22:22   ` Mehdi Saada
2018-02-13 17:46     ` Jeffrey R. Carter
2018-02-13 20:19       ` Mehdi Saada
2018-02-13 21:24         ` Bojan Bozovic
2018-02-13 23:03           ` Mehdi Saada
2018-02-13 23:03             ` Mehdi Saada
2018-02-14  7:00               ` Bojan Bozovic
2018-02-14 12:04                 ` Mehdi Saada
2018-02-16 23:40                   ` Mehdi Saada
2018-02-17  1:13                     ` Mehdi Saada
2018-02-13  0:01 ` Mehdi Saada
2018-02-13  0:42   ` Mehdi Saada
2018-02-13  1:32     ` Mehdi Saada
2018-02-13  4:16       ` Bojan Bozovic
2018-02-13 11:28       ` Simon Wright
2018-02-13 12:03         ` Mehdi Saada [this message]
2018-02-13 13:25         ` Dmitry A. Kazakov
2018-02-19 18:10 ` Mehdi Saada
2018-02-19 18:16   ` Simon Clubley
replies disabled

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