comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: strange cursor in nested containers
Date: Thu, 20 Apr 2023 15:59:35 +0100	[thread overview]
Message-ID: <lyttxak3ag.fsf@pushface.org> (raw)
In-Reply-To: 6aa39f27-62ca-4486-9fc7-1c713da5b098n@googlegroups.com

Egil H H <ehh.public@gmail.com> writes:

> Each call to `element(n)` returns a _copy_ of the element, which in
> this case includes the enitre doubly linked list

This is indeed the problem, thanks!

I hadn't considered the effect of renaming a function call; the cursor
constructed inside query_net refers to the locally renamed copy of
type_net, which will be destroyed on exit from query_net.

>                                                  (and since `net` is a
> renames of `element(n), you would have gotten multiple copies if you
> had called `net` multiple times inside query net)

This appears to say that this renaming of a function call results in
something like a macro, but I think that

   R : T renames Func;

is more like

   R : constant T := Func;
   
ARM 8.5(3) says

   "The elaboration of a renaming_declaration evaluates the name that
   follows the reserved word renames and thereby determines the view and
   entity denoted by this name (the renamed view and renamed entity). A
   name that denotes the renaming_declaration denotes (a new view of)
   the renamed entity."

  parent reply	other threads:[~2023-04-20 14:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  7:09 strange cursor in nested containers Mario Blunk
2023-04-19 15:07 ` Simon Wright
2023-04-20  5:15 ` Egil H H
2023-04-20  5:33   ` Egil H H
2023-04-20 14:59   ` Simon Wright [this message]
2023-04-20 15:28     ` Mario Blunk
2023-04-22  9:33       ` Randy Brukardt
2023-04-22 17:04         ` Mario Blunk
2023-04-22 18:33           ` Jeffrey R.Carter
2023-04-25  7:30             ` Mario Blunk
2023-05-09  3:56               ` Randy Brukardt
2023-05-09  8:36                 ` Jeffrey R.Carter
2023-05-09  8:49                   ` 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