Egil H H <
ehh.p...@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."