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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.szaf.org!news.enyo.de!.POSTED!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: {Pre,Post}conditions and side effects Date: Tue, 23 Dec 2014 22:53:34 +0100 Message-ID: <877fxi58yp.fsf@mid.deneb.enyo.de> References: <2430252d-52a1-4609-acef-684864e6ca0c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.enyo.de 1419371614 29046 192.168.18.20 (23 Dec 2014 21:53:34 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:UDHBk91arIPbAQpOP+Nl5bwKZtI= Xref: news.eternal-september.org comp.lang.ada:24209 Date: 2014-12-23T22:53:34+01:00 List-Id: * Brad Moore: > There is a proposal to have a Global aspect to be considered for Ada > 202x, that could be applied to subprograms. Such an aspect would > indicate if a subprogram body referenced any global variables. It > would also indicate if a subprogram references no globals. > > eg. > function Foo (X : Integer) return Integer > with Globals => null; > > I believe such a subprogram would not have side-effects It could still call subprograms which modify global variables, or use its arguments to modify global state. Even if you solve this (different, quite feasible approaches exist), (lack of) termination of the evaluation of conditions would still be a visible side effect, and that's more difficult to tackle.