comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Question about sets and expression
Date: Mon, 8 May 2017 08:53:21 -0700 (PDT)
Date: 2017-05-08T08:53:21-07:00	[thread overview]
Message-ID: <83325a39-b5b1-4742-a28b-4a8631379d43@googlegroups.com> (raw)

Hi,

I did not manage to make a simple test program for this problem,
but maybe someone can give me a hint here. I start to be "blind" :-)

os is here an Ordered_Set (not empty). The first part seems OK,
but the second part is confusing (craches).

-------------------------------------------------------------------------------
-- First part (seems OK):
       Put_Line(" Here A ");

       if not os.is_empty then
          Put_Line(" Here B ");
          c := os.first_element;
       else
          Put_Line(" Here C ");
          c := (id => Cnil, others => <>);
       end if;

       Put_Line(" Here D ");

------------------------------------------------------------------------------
-- Second part (here it goes wrong):
       c := (if not os.is_empty then os.first_element 
                        else (id => Cnil, others => <>));
       Put_Line(" Here E ");
------------------------------------------------------------------------------

*  Here is an example of output from this code:

 Here A 
 Here B 
 Here D 

Exception raised
Exception name: STORAGE_ERROR
Message: s-intman.adb:139 explicit raise

reinert

             reply	other threads:[~2017-05-08 15:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 15:53 reinert [this message]
2017-05-08 16:06 ` Question about sets and expression Robert Eachus
2017-05-08 17:03   ` reinert
2017-05-08 17:04   ` reinert
2017-05-08 19:00 ` Simon Wright
2017-05-09  3:58   ` reinert
2017-05-09  5:48     ` reinert
2017-05-09  6:23       ` Niklas Holsti
2017-05-09  6:29       ` G.B.
2017-05-09  7:14         ` reinert
2017-05-09  9:28       ` gautier_niouzes
2017-05-09 11:15       ` Simon Wright
replies disabled

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