comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Will "renames" increase program size?
Date: Fri, 17 Jun 2011 08:53:21 +0200
Date: 2011-06-17T08:53:21+02:00	[thread overview]
Message-ID: <12lr1j2mmzidu.18gjo4p3e73kk$.dlg@40tude.net> (raw)
In-Reply-To: ite47q$cik$1@munin.nbi.dk

On Thu, 16 Jun 2011 18:39:35 -0500, Randy Brukardt wrote:

>>Semantically returning result of a function is always copying because the
>>object being returned changes the scope.
> 
> "Changing scope" doesn't require a copy in either RM or some sort of outside 
> logical universe. The only thing that the "scope" of an object controls is 
> when it is finalized, and that has nothing to do with the contents (from a 
> logical perspective) of the object.

I fail to see how finalization could have nothing to do with the contents.
Finalized objects have no contents, they do not even exist.

> In further cases, Ada 
> requires that the anonymous object "mutate" into the target object with no 
> copying ("built-in-place"); this too changes scope.

Yep, "mutating", that is the term of the RM, I should have used instead of
"copying"! (:-))

So, the correct statement should have been: when the result of a function
is renamed it *mutates* into the target of renaming. Hmm, what is the RM
term for a non-existent thing?

(And some functions do not "return", they "build"!)

> The point is that copying has a visible semantic effect,

The cases under consideration are ones where copying should have no
semantic effect, e.g. parameter passing.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-06-17  6:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15  2:10 Will "renames" increase program size? Adrian Hoe
2011-06-15  5:37 ` Randy Brukardt
2011-06-15  9:11   ` AdaMagica
2011-06-15 11:26     ` Yannick Duchêne (Hibou57)
2011-06-15 11:24   ` Yannick Duchêne (Hibou57)
2011-06-15 13:15     ` Dmitry A. Kazakov
2011-06-16  6:59       ` AdaMagica
2011-06-16  8:59         ` Dmitry A. Kazakov
2011-06-16 10:18           ` AdaMagica
2011-06-16 12:15             ` Dmitry A. Kazakov
2011-06-16 23:22             ` Randy Brukardt
2011-06-16 15:40           ` Adam Beneschan
2011-06-16 16:33             ` Dmitry A. Kazakov
2011-06-16 17:42               ` Adam Beneschan
2011-06-16 18:53                 ` Dmitry A. Kazakov
2011-06-16 23:39                   ` Randy Brukardt
2011-06-17  6:53                     ` Dmitry A. Kazakov [this message]
2011-06-18  0:02                       ` Randy Brukardt
2011-06-18  7:54                         ` Dmitry A. Kazakov
2011-06-18  8:58                           ` Yannick Duchêne (Hibou57)
2011-06-18 10:05                             ` Dmitry A. Kazakov
2011-06-18 12:49                               ` Yannick Duchêne (Hibou57)
2011-06-18 22:44                           ` Randy Brukardt
2011-06-22  0:56                             ` Shark8
2011-06-15 22:21 ` anon
replies disabled

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