comp.lang.ada
 help / color / mirror / Atom feed
* Question about sets and expression
@ 2017-05-08 15:53 reinert
  2017-05-08 16:06 ` Robert Eachus
  2017-05-08 19:00 ` Simon Wright
  0 siblings, 2 replies; 12+ messages in thread
From: reinert @ 2017-05-08 15:53 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-05-09 11:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08 15:53 Question about sets and expression reinert
2017-05-08 16:06 ` 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

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