comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: How to return an empty aggregate
Date: Tue, 1 Apr 2008 10:18:23 -0700 (PDT)
Date: 2008-04-01T10:18:23-07:00	[thread overview]
Message-ID: <7a936089-270d-4ac2-9d7f-ec39ef3e96ef@s19g2000prg.googlegroups.com> (raw)
In-Reply-To: 69046060-8641-4e6b-95a9-232c6a8059ba@e6g2000prf.googlegroups.com

On Apr 1, 5:54 am, Anh Vo <anhvofrc...@gmail.com> wrote:
> On Apr 1, 4:58 am, Maciej Sobczak <see.my.homep...@gmail.com> 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




  reply	other threads:[~2008-04-01 17:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 11:58 How to return an empty aggregate Maciej Sobczak
2008-04-01 12:54 ` Anh Vo
2008-04-01 17:18   ` Adam Beneschan [this message]
2008-04-02  7:16     ` Maciej Sobczak
2008-04-01 13:34 ` Dmitry A. Kazakov
2008-04-01 15:00 ` Robert A Duff
2008-04-02  7:19   ` Maciej Sobczak
2008-04-03  5:02     ` george.priv
2008-04-03  9:09       ` Maciej Sobczak
2008-04-04 15:38         ` george.priv
2008-04-04 20:35           ` Maciej Sobczak
2008-04-04 23:58             ` george.priv
2008-04-05 13:48               ` Maciej Sobczak
2008-04-05 16:04                 ` george.priv
2008-04-05 21:14                   ` Maciej Sobczak
2008-04-05 22:36                     ` george.priv
2008-04-06 19:53                       ` Maciej Sobczak
2008-04-06  7:00                     ` george.priv
2008-04-06 20:04                       ` Maciej Sobczak
2008-04-07 20:23                         ` george.priv
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox