comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Possible GNAT problem with aliased parameters.
Date: Sat, 19 Oct 2013 14:17:17 -0700 (PDT)
Date: 2013-10-19T14:17:17-07:00	[thread overview]
Message-ID: <28e86e6c-f2e1-4cca-abce-cd6f73447f4d@googlegroups.com> (raw)
In-Reply-To: <f7ead12a-b08a-4829-8122-74a57c4e658f@googlegroups.com>

On Saturday, October 19, 2013 8:30:05 AM UTC-6, sbelm...@gmail.com wrote:
> 
> function Create (North, South, East, West : aliased in out Maze'Class:= None) return Maze

That won't work; the default and IN OUT cannot be used together.

> The only way would be to hack it together with access discriminants:
>
> type Maze (n : access Maze'Class;
>           s : access Maze'Class;
>           e : access Maze'Class;
>           w : access Maze'Class) is tagged null record;

That's rather unfortunate; having them in an array-component would be the best for the processing I'm planning [where a "fore X of" would be nice]. (What I showed was a simplified example; there's a bit more in the actual structure [two Strings]).

>This is a shame, because the aliased parameter/access discriminant method works so well for simple composition of one object, and extending it to arrays of objects would eliminate what is essentially the last unnecessary use of access types (I bemoaned the inability to pass around arrays of local access types awhile back in another thread, and this is another good example of why). 

I think I understand what you're saying here; but would you give a usage-example of what you'd do with such?

  reply	other threads:[~2013-10-19 21:17 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 [this message]
2013-10-20  6:29           ` Shark8
2013-10-20 15:33             ` sbelmont700
2013-10-21  0:29               ` Shark8
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