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!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 26 Mar 2017 15:57:39 -0500 Subject: Re: Test for constant (or "in parameter" in procedure) Newsgroups: comp.lang.ada References: From: Norman Worth Date: Sun, 26 Mar 2017 14:57:40 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-ZUNSII+MTB0XOHVHcVqOz+V98yN5fxLzqNqCmDVsQMmrfLbSQxWR9gvTFTThE1U8EMdKWSGMFg0ytNH!OYjVx++/aIyZtndYOeSEpWN06eJN7aFX4NyjU7l3b9ODrUESx+VKxSbDmMO+MX73KCNW8+jO/8I= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2053 Xref: news.eternal-september.org comp.lang.ada:46470 Date: 2017-03-26T14:57:40-06:00 List-Id: reinkor wrote: > Hi, > > is it a good way to test if an object is a constant or not (or "in parameter" in a procedure)? Something in addition to declare it as a constant? > > If I am sure an object is a constant (and can check it) then this can sometimes help to structure/optimize the code. I would like to have some redundancy and make sure an object is really constant when this is a prerequisite for a piece of code to be according to my intentions - i.e. if the object is messed with somewhere, then things could go wrong. So I would like some "local check" to be sure a constant is really a constant :-) Specially if many people are involved to change code over time. > > reinert > This might best be handled by a comment warning that the constant must be a constant (or in parameter) because of its later use.