From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,e55912fa8f040ab5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: GNAT GPL 2009 - issue with floating points? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4acf9ee2$0$23472$426a34cc@news.free.fr> <6d8f169d-5dc8-465c-9368-be91efc2de0f@v15g2000prn.googlegroups.com> <4acfb607$0$412$426a34cc@news.free.fr> <7d4eb248-3730-4bf0-af51-72a062778510@u16g2000pru.googlegroups.com> <4ad02c34$0$9952$426a74cc@news.free.fr> <1x0s4pludozr7$.r1whvkk9abyn$.dlg@40tude.net> Date: Sun, 11 Oct 2009 12:27:15 +0200 Message-ID: <1y6imbz0dijq$.1ofvdwq3q3cz7.dlg@40tude.net> NNTP-Posting-Date: 11 Oct 2009 12:27:15 CEST NNTP-Posting-Host: bb6a6f2e.newsspool4.arcor-online.net X-Trace: DXC=Kn?URch3o1mFXUDVUnEXQm4IUK8^;Jm2Coki[6LHn;2LCVn[ 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