Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: How to retu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 20 Topic 5632 of 5922
Post > Topic >>

Re: How to return an empty aggregate

by Adam Beneschan <adam@[EMAIL PROTECTED] > Apr 1, 2008 at 10:18 AM

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




 20 Posts in Topic:
How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-01 04:58:06 
Re: How to return an empty aggregate
Anh Vo <anhvofrcaus@[E  2008-04-01 05:54:00 
Re: How to return an empty aggregate
"Dmitry A. Kazakov&q  2008-04-01 15:34:04 
Re: How to return an empty aggregate
Robert A Duff <bobduff  2008-04-01 11:00:19 
Re: How to return an empty aggregate
Adam Beneschan <adam@[  2008-04-01 10:18:23 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-02 00:16:40 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-02 00:19:00 
Re: How to return an empty aggregate
george.priv@[EMAIL PROTEC  2008-04-02 22:02:37 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-03 02:09:11 
Re: How to return an empty aggregate
george.priv@[EMAIL PROTEC  2008-04-04 08:38:52 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-04 13:35:19 
Re: How to return an empty aggregate
george.priv@[EMAIL PROTEC  2008-04-04 16:58:36 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-05 06:48:36 
Re: How to return an empty aggregate
george.priv@[EMAIL PROTEC  2008-04-05 09:04:29 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-05 14:14:04 
Re: How to return an empty aggregate
george.priv@[EMAIL PROTEC  2008-04-05 15:36:36 
Re: How to return an empty aggregate
george.priv@[EMAIL PROTEC  2008-04-06 00:00:18 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-06 12:53:11 
Re: How to return an empty aggregate
Maciej Sobczak <see.my  2008-04-06 13:04:55 
Re: How to return an empty aggregate
george.priv@[EMAIL PROTEC  2008-04-07 13:23:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 15:00:15 CDT 2008.