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: 103376,64fe8f87aae99538 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!s19g2000prg.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: How to return an empty aggregate Date: Tue, 1 Apr 2008 10:18:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7a936089-270d-4ac2-9d7f-ec39ef3e96ef@s19g2000prg.googlegroups.com> References: <69046060-8641-4e6b-95a9-232c6a8059ba@e6g2000prf.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207070303 16690 127.0.0.1 (1 Apr 2008 17:18:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 1 Apr 2008 17:18:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s19g2000prg.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20732 Date: 2008-04-01T10:18:23-07:00 List-Id: On Apr 1, 5:54 am, Anh Vo wrote: > On Apr 1, 4:58 am, Maciej Sobczak wrote: > > > > > In my previous post I had the following: > > > type Concrete is new Middle with null record; > > > function Make_Concrete return Concrete is > > C : Concrete; > > begin > > return C; > > end Make_Concrete; > > > I would like to return the empty(?) aggregate instead of the dummy > > local variable. > > Is there a way to do this? > > > The following: > > > return Concrete' (others => <>); > > > results in segmentation fault on my system (compiler version as > > before). > > Did you get seg fault during run time or the compiler crashed with seg > fault? > > By the way, the return statement should be flagged as syntax error due > to missing the base type Middle. If you're talking about the last return statement: return Concrete' (others => <>); why would this be a syntax error? I don't know of any language rule that would require a reference to "Middle" to be present, if that's what you're saying. As far as I can tell, what Maciej is trying to do is perfectly fine, there aren't any language corners that would cause a problem, and the compiler is misbehaving. -- Adam