comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent <lutgenl@icloud.com>
Subject: Re: Experimenting with the OOP features in Ada
Date: Tue, 3 Jan 2017 05:39:46 -0800 (PST)
Date: 2017-01-03T05:39:46-08:00	[thread overview]
Message-ID: <9f6b6a5a-2f0b-4fbd-8171-36199caa6e49@googlegroups.com> (raw)
In-Reply-To: <o4eeoi$1cj2$1@gioia.aioe.org>

On Monday, 2 January 2017 21:55:49 UTC+1, Dmitry A. Kazakov  wrote:

> Your Create function creates a whole object.
> 
Ok my fault. Transformed the into procedures and changed the name.

> > I am quite tempted in using the persistent storage capabilities of
> > Simple Components but that means that I have to adapt my program to the
> > style of this library. Don't think that it would be possible to only graft
> > it
> > at the latest moment?
> > > 
> It is not style, but a plain conceptual error. You are using a 
> constructing function as if it were a setter. That won't work anywhere 
> in any language.
> 
Wasn't what I tried to say. In the docs about persistent objects you write:
"Like other objects, persistent ones are normally accessed through handles."

The old version of my program doesn't contain handles. No access values or
whatever.
So I have actually to rewrite it completely from the beginning and adapt it to
Simple Components.

> > BTW what is the reach of the overriding keyword i.e.:
> > > 
> The keyword hints the compiler that the subprogram overrides the 
> parent's implementation. If you make a mistake in the parameter profile, 
> the compiler will reject the program. It adds a lot of safety. If not 
> keeping it Ada 95 compatible, always use "overriding" and "not 
> overriding" when declaring operations on tagged types. It is a good style.
> 
> 
But I have to put it for every function/procedure.
It won't work if I just put it at the first possible place and expect that the
compiler will automagically figure out where to apply it.

> > Gnat was only complaining that Create_Name needs overriding even if
> > Create_Code_SIL is also in the Base_Type which is abstract.
> > > 
> This a different story. Here the compiler complains that you forgot to 
> override an operation that must be overridden. Overriding is required 
> for abstract operations and operations returning new objects. In the 
> first case there is no implementation to inherit from. In  the second 
> case the implementation would be most likely garbage.
> 
> 
After changing the functions to procedures gnat complains that Set_Code_SIL
doesn't override. Before the change it didn't even it should have done so?
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de
> 

Thanks


  reply	other threads:[~2017-01-03 13:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02 13:21 Experimenting with the OOP features in Ada Laurent
2017-01-02 14:11 ` Brian Drummond
2017-01-02 14:43   ` Brian Drummond
2017-01-02 16:27     ` Laurent
2017-01-03 13:01       ` Brian Drummond
2017-01-03 13:57         ` Laurent
2017-01-03 14:31           ` Dmitry A. Kazakov
2017-01-03 17:07             ` G.B.
2017-01-03 20:42               ` Dmitry A. Kazakov
2017-01-04 12:18             ` Laurent
2017-01-04 12:44               ` Dmitry A. Kazakov
2017-01-05 11:41                 ` Laurent
2017-01-05 13:02                   ` Dmitry A. Kazakov
2017-01-05 13:11                   ` AdaMagica
2017-01-04 15:09               ` Shark8
2017-01-05 11:54                 ` Laurent
     [not found]     ` <85ef59f3-bcbe-4630-9b4d-8285623ab456@googlegroups.com>
2017-01-03 12:48       ` Brian Drummond
2017-01-03 13:43         ` Laurent
2017-01-02 15:54   ` Laurent
2017-01-02 16:41 ` Dmitry A. Kazakov
2017-01-02 18:50   ` Laurent
2017-01-02 20:55     ` Dmitry A. Kazakov
2017-01-03 13:39       ` Laurent [this message]
2017-01-03 14:40         ` 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