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-05-31 20:19:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3ED970CF.3080008@spam.com> From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to model unknown values in a vector? References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 01 Jun 2003 03:17:35 GMT NNTP-Posting-Host: 63.184.0.142 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1054437455 63.184.0.142 (Sat, 31 May 2003 20:17:35 PDT) NNTP-Posting-Date: Sat, 31 May 2003 20:17:35 PDT Xref: archiver1.google.com comp.lang.ada:38264 Date: 2003-06-01T03:17:35+00:00 List-Id: Harald Schmidt wrote: > > Does anyone know how to model values in a vector, which are unknown. > I can't use the zero value because this is a valid value. Minus > infinity could be an option, but I am searching for a better method > to handle unknown values. Use this type for the vector elements: type Vector_Element (Value_Known : Boolean := False) is record case Value_Known is when False => null; when True => Value : Real_Vector_Element_Type [:= Some_Useful_Default_Value]; end case; end record; -- Jeff Carter "When Roman engineers built a bridge, they had to stand under it while the first legion marched across. If programmers today worked under similar ground rules, they might well find themselves getting much more interested in Ada!" Robert Dewar