comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: anonymous aggregates?
Date: Sun, 02 Sep 2012 07:25:25 -0400
Date: 2012-09-02T07:25:25-04:00	[thread overview]
Message-ID: <85ligsvf8a.fsf@stephe-leake.org> (raw)
In-Reply-To: 5041dc1d$0$6578$9b4e6d93@newsspool3.arcor-online.net

Georg Bauhaus <rm.dash-bauhaus@futureapps.de> writes:

> 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.

Good point; anonymous arrays are different types, and cannot be assigned
to each other. So anonymous records should be the same, which defeats
the purpose.

-- 
-- Stephe



  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
2012-09-02 11:25     ` Stephen Leake [this message]
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