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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Not intended for use in medical, Date: 1997/05/16 Message-ID: #1/1 X-Deja-AN: 241963486 References: <3.0.32.19970423164855.00746db8@mail.4dcomm.com> <5kmek2$9re@bcrkh13.bnr.ca> <01bc6006$c13cf880$LocalHost@xhv46.dial.pipex.com> <01bc6182$30e3a7c0$LocalHost@xhv46.dial.pipex.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-05-16T00:00:00+00:00 List-Id: Nick asks/says <> (of functions with useful side effects) No, I don't think so, this horse has been beaten to death too many times to be worth discussing any more. Well I will give just one phrase, memo functions, that should be enough! Note that this issue was discussed in the very early stages of the language design, and everyone agrees that there is a necessity in a language like Ada to permit functions with side effects. The issue that was discussed was whether to distinguish between functions without side effects, and value returning procedures with side effects. But even that attempt fails, because you can have functions that at a conceptual interface level are pure, but their implementations require side effects (memo functions are the canonical example). Note that it will work just fine to give the pragma Pure_Function in GNAT for a memo function, even though it has side effects. <> The Pure is completely irrelevant here, the problem has no solution in pure Ada without using the heap even if you did not have pragma Pure. Furthermore the idea that children of a pure package must be pure is a pretty serious misconception about the whole structure of child packages. It is of course the other way round, you cannot have pure children of an impure parent, but OF COURSE you can have impure children of pure parents -- what would make you think this was not allowed. <> As above, you are confused. <> If you see something that seems odd to you in the RM, it is quite likely that, as in this case, it corresponds to a misunderstanding on your part. As per above, there is no extra Pure, and the Pure here is important.