comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GNAT GPL 2009 - issue with floating points?
Date: Sun, 11 Oct 2009 12:27:15 +0200
Date: 2009-10-11T12:27:15+02:00	[thread overview]
Message-ID: <1y6imbz0dijq$.1ofvdwq3q3cz7.dlg@40tude.net> (raw)
In-Reply-To: has8oh$mbq$1@news.albasani.net

On Sun, 11 Oct 2009 11:33:04 +0200, Dirk Herrmann wrote:

> Dmitry A. Kazakov wrote:
>> On Sat, 10 Oct 2009 08:39:47 +0200, Damien Carbonne wrote:
>> 
>>> Thanks, now things are clearer. I understand that the compiler can not 
>>> determine Real'Size when it compiles the generic package, but when it is 
>>> instantiated, it should have then necessary knowledge.
>> 
>> Not if the generic body is shared, rather than expanded.
> 
> It seems that the rules for generics are designed to allow sharing.

They were.

Presently, I don't know if shared / contracted model is any alive.
Considering:

   generic
      type J is interface and I;
   package P is
      type T is new J with null record;
   end P;

When compiling P you cannot know if the actual for J does not have an
abstract operation which T does not implement.

Nevertheless one tries to pretend that generics still have some kind of
"contracts".

> It 
> surprises me, however, that there is no means to state that sharing is not 
> required, like, for example, a pragma or attribute. Such generics would offer 
> more implementation possibilities, since more information would be static.

In that case it should be a syntax element, not a pragma.

> I 
> understand the desire to support sharing, but for me it is a resource issue 
> (affecting ROM size and execution time) that might better be put under control 
> of the developer.

Then the solution is wrong. The desire is not to share bodies, but to have
contracts. With generics this goal is most likely unachievable.

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



  reply	other threads:[~2009-10-11 10:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-09 20:36 GNAT GPL 2009 - issue with floating points? Damien Carbonne
2009-10-09 21:06 ` Adam Beneschan
2009-10-09 22:15   ` Damien Carbonne
2009-10-09 22:44     ` Ludovic Brenta
2009-10-10  6:33       ` Damien Carbonne
2009-10-10 14:55       ` Samuel Tardieu
2009-10-10 16:12         ` Ludovic Brenta
2009-10-10 16:38         ` Damien Carbonne
2009-10-09 23:26     ` Adam Beneschan
2009-10-10  6:39       ` Damien Carbonne
2009-10-10  7:16         ` Dmitry A. Kazakov
2009-10-11  9:33           ` Dirk Herrmann
2009-10-11 10:27             ` Dmitry A. Kazakov [this message]
2009-10-12 23:26               ` 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