From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,5ebeef2944e4167d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.75.8 with SMTP id y8mr5141308wiv.4.1346980967114; Thu, 06 Sep 2012 18:22:47 -0700 (PDT) Path: q11ni5513255wiw.1!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: anonymous aggregates? References: <85mx1bwec4.fsf@stephe-leake.org> <5041dc1d$0$6578$9b4e6d93@newsspool3.arcor-online.net> Date: Sun, 02 Sep 2012 07:25:25 -0400 Message-ID: <85ligsvf8a.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (windows-nt) Cancel-Lock: sha1:9iRp7INY7ih0ybJY68Fx8kNNcp0= MIME-Version: 1.0 X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 857c450434228e029e66127065 X-Received-Bytes: 2055 Content-Type: text/plain Date: 2012-09-02T07:25:25-04:00 List-Id: Georg Bauhaus writes: > On 01.09.12 00:37, Randy Brukardt wrote: >> "Stephen Leake" 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