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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1df6bc3799debed X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Not intended for use in medical, Date: 1997/05/16 Message-ID: #1/1 X-Deja-AN: 241956011 References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com> <01bc6006$c13cf880$LocalHost@xhv46.dial.pipex.com> <01bc6182$30e3a7c0$LocalHost@xhv46.dial.pipex.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-05-16T00:00:00+00:00 List-Id: In article <01bc6182$30e3a7c0$LocalHost@xhv46.dial.pipex.com>, Nick Roberts wrote: >Quite right. I was forgetting that as the packages >Ada.Numerics.Float_Random and Ada.Numerics.Discrete_Random are >grandchildren of the package Ada, which is declared as pure, they must be >pure also, ... There is no such rule. Ada.Numerics.Float_Random and Ada.Numerics.Discrete_Random are in fact *not* pure. AARM-A.5.2(27.a) explains why. Note that all library units are (direct or indirect) children of Standard. And Standard is declared Pure. So the (nonexistent) rule you stated above wouldn't quite work -- good thing it's not in the RM! ;-) >...(Is this it, or is there some other reason >that I have missed?) As Robert said: Try to write the code using only portable features -- I think you'll find that there's nowhere to put the Generator data, except in the heap. (Actually, I suppose I should say "a heap" -- you could create your own data structure that acts as a heap.) No fair using Unchecked_Conversion to convert an Address (or an access-to-constant) to an access-to-variable type -- you could do it that way on some compilers, but it's not formally portable. Actually, the semantics of GNAT's 'Unrestricted_Access are defined as Unch_Conv of a 'Address -- which of course doesn't really "define" the semantics at all, since the semantics of such an unchecked conversion is not defined. An 'in' parameter is a constant. If you succeed in modifying one, you are necessarily doing something undefined! - Bob