comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Possible GNAT problem with aliased parameters.
Date: Sun, 20 Oct 2013 17:29:36 -0700 (PDT)
Date: 2013-10-20T17:29:36-07:00	[thread overview]
Message-ID: <d743bd5f-816e-4998-b7c1-a49ea21acd62@googlegroups.com> (raw)
In-Reply-To: <7ce0c2bc-7720-4a90-a31e-e723a9e47d4b@googlegroups.com>

On Sunday, October 20, 2013 9:33:15 AM UTC-6, sbelm...@gmail.com wrote:
> As long as you are onto the heap anyway, why not just make the client create the array (with items on the heap) save a reference to that, and avoid all the headaches?

For what I'm doing the main use-case is reading from a text-file, building the structures, and passing that out to some game-"engine"/interface. -- I just wanted/needed a way to create the objects programatically to ensure the read/write are correct, and it seemed odd that the aliased parameters weren't working as expected.

> The use case I would like is essentially this, with some magic feature that lets you satisfy the accessibility check for local values since the code is obviously not creating dangling pointers.  After all, you can pass pointers safely by themselves (access parameters) and nested within a record (access discriminant), so there ought to be some mechanism that allows you to pass them around safely within an array, if for no other reason that consistency.

Interesting; I _think_ the reason that the access-discriminant works is that the record itself has a deeper level than the access, thus when the record leaves scope the access may or may not be viable: the access could have the same scope as the record, or the record nested inside the scope declaring the access.

  reply	other threads:[~2013-10-21  0:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 16:01 Possible GNAT problem with aliased parameters Shark8
2013-10-18 16:51 ` sbelmont700
2013-10-19  1:59   ` Randy Brukardt
2013-10-19  5:48     ` Shark8
2013-10-19  7:48       ` Dmitry A. Kazakov
2013-10-19 14:30       ` sbelmont700
2013-10-19 21:17         ` Shark8
2013-10-20  6:29           ` Shark8
2013-10-20 15:33             ` sbelmont700
2013-10-21  0:29               ` Shark8 [this message]
2013-10-21  0:55                 ` sbelmont700
replies disabled

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