comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: strange cursor in nested containers
Date: Sat, 22 Apr 2023 04:33:37 -0500	[thread overview]
Message-ID: <u209li$37hob$1@dont-email.me> (raw)
In-Reply-To: ed311a62-41ba-493e-a4cc-481402a1cc6bn@googlegroups.com

I agree. If you used a debugging container that checked for dangling 
cursors, you probably would have gotten an exception from any use of the 
cursor to the dead copy. Not sure that would have been any clearer as to the 
cause, but it would be a suggestion. (Not sure if GNAT still has debugging 
containers, they did at one point, but a lot of work has been done on them 
since.)

              Randy.

"Mario Blunk" <mario.blunk.gplus@gmail.com> wrote in message 
news:ed311a62-41ba-493e-a4cc-481402a1cc6bn@googlegroups.com...
Thanks for your replies. Now it is becoming clear to me:

1. The statement net : type_net renames element (n) gives a copy of element 
(n).
2. After the assignment to "result" (line 55), "result" points to an element 
inside the local copy "net".
3. Once "net" is overwritten in the next call of query_net, "result" still 
refers to a "net" that does not exist anymore. Likewise, once procedure 
query_net is left, "result" still points to a list that does not exist 
anymore. Thatswhy I get garbage in line 68 and 77.
Correct ?




  reply	other threads:[~2023-04-22  9:33 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
2023-04-20 15:28     ` Mario Blunk
2023-04-22  9:33       ` Randy Brukardt [this message]
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