comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: anonymous aggregates?
Date: Fri, 31 Aug 2012 17:37:48 -0500
Date: 2012-08-31T17:37:48-05:00	[thread overview]
Message-ID: <k1rec3$68q$1@munin.nbi.dk> (raw)
In-Reply-To: 85mx1bwec4.fsf@stephe-leake.org

"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. ;-)

I suspect that this was not done originally in Ada mainly because of 
concerns about arbitrarily introducing additional identifiers in the middle 
of other declarations. Not sure that's a real problem; there might be some 
weird visibility issues that arose.

                                       Randy.





  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 [this message]
2012-08-31 22:57   ` Shark8
2012-09-01  9:57   ` Georg Bauhaus
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