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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,78ec96be17741f16 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!newsfeed.freenet.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Unclear error message - please help Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <432C8690.C37D4AE0@alfred-hilscher.de> <43482077.3434FCF3@alfred-hilscher.de> Date: Sat, 8 Oct 2005 23:28:12 +0200 Message-ID: NNTP-Posting-Date: 08 Oct 2005 23:28:11 MEST NNTP-Posting-Host: 60841a5c.newsread2.arcor-online.net X-Trace: DXC=O:7nmWC?\YahlIa[YhA;>cQ5U85hF6f;djW\KbG]kaMhGSi?jHD8GO`L86BA9B_9Uk[6LHn;2LCVn[4k4b?[h X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:5514 Date: 2005-10-08T23:28:11+02:00 List-Id: On Sat, 08 Oct 2005 21:39:35 +0200, Alfred Hilscher wrote: > Robert A Duff schrieb: >> >> Don't use Integer all over the place, but instead use >> different types, to avoid confusion. > > Ok, I tried it, but it seems that a "subtype" is also not the solution: That cannot have any effect. Subtypes do not resolve ambiguity. > package spec: > package Pkg is > > subtype > Sixteen_Bits is Integer range 0..65535; > > procedure Proc (Host : STRING; RC : out Integer; Identifier : in > Sixteen_Bits := 0); > > procedure Proc (Host : STRING; > Time_Response : out Integer; RC : out Integer; > Time_Wait : Integer := 10; > Identifier : in Sixteen_Bits := 0); > end Pkg; Why Time_Wait, Time_Response are Integers? Consider making them Time (absolute time is always more reliable), or maybe Duration (time span) or at least type Milliseconds is new Natural; -- This is not Integer! Similarly Identifier should be a different type, probably a modular one, better private. type Sixteen_Bits is mod 2**16; It could look like: type ID is private; No_ID : constant ID; procedure Proc ( Host : String; Count : out Natural; Identifier : ID := No_ID ); procedure Proc ( Host : String; Count : out Natural; Time_Stamp : out Time; Time_Out : Duration := 0.01; Identifier : ID := No_ID ); -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de