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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,64afbf156d06bbe7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-26 07:05:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!newsfeed.stueberl.de!teaser.fr!oleane.net!oleane!nnrp.oleane.net!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: 'Valid, subtypes and constraint checking Date: Fri, 26 Sep 2003 15:13:42 +0200 Organization: Adalog Message-ID: <52e1lb.bua.ln@skymaster> References: NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1064584879 5747 195.25.228.57 (26 Sep 2003 14:01:19 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 26 Sep 2003 14:01:19 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:42988 Date: 2003-09-26T15:13:42+02:00 List-Id: "Peter Amey" a �crit dans le message de news:bl18e1$6ot2h$1@ID-69815.news.uni-berlin.de... > Some guidance please to reduce the slight panic I am suffering from. > > When reading in values from an external device it is important to check > that the value read is a valid representation for its type. The read > values are also considered volatile so each read returns a potentially > different value. > [...] > (Horrible strawman solution: do an unchecked conversion of External_Port > into Temp and then do the validity check). > Not a horrible solution. You cannot assume your value is a T until you have checked for it! As long as all you know is that it is a set of bits, put it in a variable appropriate for sets of bits. *After* validity checking, you can consider it a T. And Unchecked_Conversion is the appropriate tool for changing the view on a give set of bits. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr