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-Thread: 103376,8ee4430d1820a774 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!p69g2000hsa.googlegroups.com!not-for-mail From: gpriv@axonx.com Newsgroups: comp.lang.ada Subject: Re: GNAT.Sockets: Timeval_Duration is in milliseconds? Date: Sun, 9 Dec 2007 07:55:02 -0800 (PST) Organization: http://groups.google.com Message-ID: <314aea38-7dc1-462e-b272-31817c147996@p69g2000hsa.googlegroups.com> References: <99906a58-2645-4880-bd13-9b63a30ffb59@e4g2000hsg.googlegroups.com> <11adowbxp1rax$.13d1jgzb1wtsn.dlg@40tude.net> NNTP-Posting-Host: 151.196.71.114 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1197215702 8717 127.0.0.1 (9 Dec 2007 15:55:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 9 Dec 2007 15:55:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p69g2000hsa.googlegroups.com; posting-host=151.196.71.114; posting-account=YaY8rAoAAAAAnFXOECY3BGVJsrvFJCgy User-Agent: G2/1.0 X-HTTP-Via: 1.1 SPARKS X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:18813 Date: 2007-12-09T07:55:02-08:00 List-Id: On Dec 9, 4:33 am, "Dmitry A. Kazakov" wrote: > On Sat, 08 Dec 2007 19:45:53 -0600, tmo...@acm.org wrote: > > The Ada 95 LRM 9.6(7) says > > "...; a value of type Duration is used to represent the length of > > an interval of time, expressed in seconds." > > > It would be bad practice to use a value of type Duration to represent, > > say, the number of gallons of gasoline remaining, and it would be even > > worse, because even more confusing, to use it to represent a number > > of milliseconds. > > Sorry but this makes no sense. The physical entity being measured is > duration T. Gallon is a measure of volume L**3. Clearly T /= L**3. As for > seconds, milliseconds, years, centuries etc, all they fall under the > category T (duration). They are numbers expressing the *same* physical > entity. It is rather instructive to use the same type for them when > possible. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Conceptually you're right, but many annoying bugs are introduced by assuming wrong scale when using same entities (feet/meter, T(K)/t(C), X/Y/Z coordinates, etc.) In order to make the language work for you one should go with different types. My favorite is X,Y,Z coordinates: all measure distance but misinterpreting those may case a trouble. So by introducing the new types for each plus one direction-less Distance type will be good safety measure while all three are distance entities. Regards, George Privalov.