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!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Renaming vs assignment to constant Date: Fri, 06 Dec 2013 09:09:12 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 6 Dec 2013 16:09:14 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="4d5ae4e50b2c862535d69240f4d04907"; logging-data="14058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PeYFfg/eZ/nGI4aWCopXRdq1QpJRB0fg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: Cancel-Lock: sha1:rgrIjLXeHZO4GaE83PCI65fjY2M= Xref: news.eternal-september.org comp.lang.ada:17870 Date: 2013-12-06T09:09:12-07:00 List-Id: On 12/06/2013 08:14 AM, Simon Wright wrote: > A poster on Stack Overflow wrote > > Now : Time renames Clock; > > (using Ada.Calendar) which made me blink until I realised that it is the > equivalent of > > Now : constant Time := Clock; > > GNAT generates the same code for these two forms. Is there a difference? > Which form is preferred? Some people are under the impression that a renaming is more "efficient". I prefer that things that are constant be explicitly declared as such. -- Jeff Carter "I was in love with a beautiful blonde once, dear. She drove me to drink. That's the one thing I'm indebted to her for." Never Give a Sucker an Even Break 109