comp.lang.ada
 help / color / mirror / Atom feed
From: maa@liacc.up.pt (Mário Amado Alves)
Subject: Re: How to model unknown values in a vector?
Date: 4 Jun 2003 08:56:39 -0700
Date: 2003-06-04T15:56:40+00:00	[thread overview]
Message-ID: <4a4de33a.0306040756.4bac474@posting.google.com> (raw)
In-Reply-To: bbjgh7$acuc1$1@ID-25716.news.dfncis.de

Ah, the joys of special values :-)

  type Valid_Value is new Value
    range First_Valid_Value .. Last_Valid_Value;

  Unknown : Value := Value'Pred (First_Valid_Value); -- say

Or, the OO way

  type Value is tagged with null record;

  type Valid_Value is new Value with
    record
      The_Value : ...
    end record;

(But then you'll probably have to use pointers, and in that case there
is always null to signal unknown...)

Both are Ada ways, no implementation dependencies.



      reply	other threads:[~2003-06-04 15:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-31 13:43 How to model unknown values in a vector? Harald Schmidt
2003-05-31 22:47 ` FranciKait
2003-06-01  3:17 ` Jeffrey Carter
2003-06-04  1:04 ` Nick Roberts
2003-06-04 15:56   ` Mário Amado Alves [this message]
replies disabled

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