comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Renaming vs assignment to constant
Date: Fri, 06 Dec 2013 09:09:12 -0700
Date: 2013-12-06T09:09:12-07:00	[thread overview]
Message-ID: <l7ssr8$dna$1@dont-email.me> (raw)
In-Reply-To: <lypppaj9jo.fsf@pushface.org>

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

  reply	other threads:[~2013-12-06 16:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 15:14 Renaming vs assignment to constant Simon Wright
2013-12-06 16:09 ` Jeffrey Carter [this message]
2013-12-06 18:03   ` AdaMagica
2013-12-06 18:24     ` Jeffrey Carter
2013-12-06 16:47 ` adambeneschan
2013-12-06 18:06   ` Eryndlia Mavourneen
2013-12-07  0:47   ` Randy Brukardt
2013-12-07  1:55     ` Shark8
2013-12-06 18:35 ` G.B.
2013-12-06 20:07   ` adambeneschan
2013-12-06 21:59 ` Shark8
2013-12-06 23:48   ` adambeneschan
2013-12-07  1:04     ` Shark8
2013-12-07  1:26       ` adambeneschan
2013-12-07  6:17       ` J-P. Rosen
2013-12-07  6:22         ` J-P. Rosen
2013-12-07  8:57   ` Dmitry A. Kazakov
2013-12-07  9:02     ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox