From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2a5cdfc27475c02f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-04 08:56:40 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: maa@liacc.up.pt (=?ISO-8859-1?Q?M=E1rio_Amado_Alves?=) Newsgroups: comp.lang.ada Subject: Re: How to model unknown values in a vector? Date: 4 Jun 2003 08:56:39 -0700 Organization: http://groups.google.com/ Message-ID: <4a4de33a.0306040756.4bac474@posting.google.com> References: NNTP-Posting-Host: 195.23.231.53 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054742200 21690 127.0.0.1 (4 Jun 2003 15:56:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 4 Jun 2003 15:56:40 GMT Xref: archiver1.google.com comp.lang.ada:38612 Date: 2003-06-04T15:56:40+00:00 List-Id: 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.