comp.lang.ada
 help / color / mirror / Atom feed
* Style Question: normal record vs discriminated null-record.
@ 2014-06-03  2:44 Shark8
  2014-06-03  4:38 ` J-P. Rosen
  2014-06-03  7:19 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 5+ messages in thread
From: Shark8 @ 2014-06-03  2:44 UTC (permalink / raw)


Ok, given some sort of alert-system (meaning there shouldn't be any/much 
in the way of value manipulation of those objects) is it preferable to 
use a discriminated null-record or a record with normal components?


     Type Grievousness is (Warning, Error);
     Type Circumstance is (Expired_Data, Bad_Request, Malformed_Data);

     Type Alert_1(Severity : Grievousness; Condition :  Circumstance) is
     null record;

     Type Alert_2 is record
         Severity  : Grievousness;
         Condition : Circumstance;
     end record;


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

end of thread, other threads:[~2014-06-03  7:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-03  2:44 Style Question: normal record vs discriminated null-record Shark8
2014-06-03  4:38 ` J-P. Rosen
2014-06-03  4:40   ` J-P. Rosen
2014-06-03  6:20   ` Shark8
2014-06-03  7:19 ` Dmitry A. Kazakov

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