From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a37:506:: with SMTP id 6mr10474794qkf.168.1608397313771; Sat, 19 Dec 2020 09:01:53 -0800 (PST) X-Received: by 2002:ac8:41cf:: with SMTP id o15mr10064115qtm.98.1608397313607; Sat, 19 Dec 2020 09:01:53 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!aioe.org!peer01.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 19 Dec 2020 09:01:53 -0800 (PST) In-Reply-To: <5fdde913$0$3238$426a74cc@news.free.fr> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.133; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 94.31.101.133 References: <5fdbde31$0$6455$426a74cc@news.free.fr> <86im8ylnj4.fsf@stephe-leake.org> <5fdde913$0$3238$426a74cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Ada syntax questions From: AdaMagica Injection-Date: Sat, 19 Dec 2020 17:01:53 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2089 Xref: reader02.eternal-september.org comp.lang.ada:60891 List-Id: DrPi schrieb am Samstag, 19. Dezember 2020 um 12:50:45 UTC+1: > Calling a function can have side effects. Accessing an array or a > variable can't have side effects. The declaration of the function is a contract about pre and post conditions, albeit in Ada incomplete. In SPARK, the contract is firm. As a user of the function, you have to believe the programmer that he follows the contract. If the implementation needs a side effect, so be it. If on the other hand you are a maintainer or are chasing a bug, you have to check the requirements first, not the body of the function. This comes later. > > You seem to be implying this is bad; why? > Reading the code can't tell you the writer's intentions. The intentions are in the requirements (or in the accompanying comments, you hope they up to date and not wrong). If there are none, good luck.