comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: anonymous aggregates?
Date: Sat, 01 Sep 2012 11:57:48 +0200
Date: 2012-09-01T11:57:49+02:00	[thread overview]
Message-ID: <5041dc1d$0$6578$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <k1rec3$68q$1@munin.nbi.dk>

On 01.09.12 00:37, Randy Brukardt wrote:
> "Stephen Leake" <stephen_leake@stephe-leake.org> wrote in message
> news:85mx1bwec4.fsf@stephe-leake.org...
> ...
>> If we introduce the notion of "anonymous aggregates" (styled after
>> "anonymous arrays"), we could do this:
>
> I'd be more likely to call this idea an "anonymous record" as that is the
> obvious counterpart to "anonymous array".
>
> declare
>      function Foo return
>         record
>            A : Integer;
>            B : Float;
>          end record
>      is begin
>          return
>              (A => 1,
>               B => 2.0);
>      end Foo;
>
> (As a side-benefit, there'd be less griping about not repeating the name in
> a record declaration. ;-)

Wouldn't we be passing objects of anonymous_type_1 that right now
cannot be assigned to anything of anonymous_type_2?
At least not without resorting to types being the same if they
happen use the same structure (and component names?), thus giving up
Ada's notion of type equivalence.




  parent reply	other threads:[~2012-09-07  1:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 10:22 anonymous aggregates? Stephen Leake
2012-08-31 11:06 ` Brian Drummond
2012-08-31 12:02 ` Dmitry A. Kazakov
2012-08-31 15:15   ` Adam Beneschan
2012-08-31 22:37 ` Randy Brukardt
2012-08-31 22:57   ` Shark8
2012-09-01  9:57   ` Georg Bauhaus [this message]
2012-09-02 11:25     ` Stephen Leake
2012-09-02 12:34       ` 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