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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d5b211b0c1ffcf3e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.238.65 with SMTP id vi1mr11263829pbc.7.1339494552784; Tue, 12 Jun 2012 02:49:12 -0700 (PDT) Path: l9ni43427pbj.0!nntp.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!novso.com!nerim.net!usenet-fr.net!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 12 Jun 2012 11:48:43 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Practicalities of Ada for app development References: <1c82b5mc3waww.1t6q6vj61u36u.dlg@40tude.net> <42a87cf3ce9bfd6054f78b2b5b356301@dizum.com> <4fd60053$0$9510$9b4e6d93@newsspool1.arcor-online.net> <4fd62785$0$9518$9b4e6d93@newsspool1.arcor-online.net> <1crzx65j543zy.1ptlx1vf7esmq.dlg@40tude.net> <4fd65a15$0$9507$9b4e6d93@newsspool1.arcor-online.net> In-Reply-To: Message-ID: <4fd7107a$0$9504$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 12 Jun 2012 11:48:42 CEST NNTP-Posting-Host: 287e20ce.newsspool1.arcor-online.net X-Trace: DXC=?fX`HEA`<@X<<0iRN7DLEQic==]BZ:af^4Fo<]lROoRQnkgeX?EC@@P>UoMUM1ISk_PCY\c7>ejVXAa<63QmIZbU32?SRFR9d>Q X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: 2012-06-12T11:48:42+02:00 List-Id: On 12.06.12 09:55, Dmitry A. Kazakov wrote: > On Mon, 11 Jun 2012 22:50:33 +0200, Georg Bauhaus wrote: > >> Reason: numeric literals typically mean a number of some "arithmetic" >> type. > > No, a numeric literal means what it tells "a number." "A number" tells little to an average reader of a program seeing just that number. >> Some_Time_Object := 45 * Seconds; > Technically Barnes is not quite right. Oh, I believe he is right and makes sure this is understood: "the expression uses the rule that a fixed[!] point value can be multiplied by an integer giving a result of the same fixed point type". (�18.3, p.465) Using whole quantities of Seconds, Minutes, and so on will give us aggregates and formulas that do not invite confusion by stipulating that the fraction can be anything but 0. > 2. You cannot multiply time, you do durations (time intervals); Like in "two times"? "Time after Time"? "Many times"? > 3. "s" or "second" is the proper name of the unit. "Seconds" is the plural of a "second" (one unit of time). "s" is asking for trouble, since "s" may well name a parameter or variable, like when copied from a formula (s = v * t, say). By comparison, is "m" the name of Meter or of Minute? > http://www.dmitry-kazakov.de/ada/units.htm > >> When using U+number, the checks are performed by one subprogram ("+"). > > Code points are numbers, not dimensioned numbers. Unit does not say anything about dimensions. Actually, "unit" is not the same as whatever dimension might mean. (Generic units...) But, indeed, my intent was say "not just typed, but expressly so", and checked. > in a properly typed languages you need no special > forms of literals. I guess that U+n stems from C-ish nL, nU etc. Uhm, no! U+number is official U-nicode notation. (Also in ISO 10646.) Can we agree that U'(16#03C0#) is o.K. even though it forces handling of range constraint violations to be global? > You can overload numeric literals in almost any context in Ada. Overloading literals is the questionable part. It is what got me started. No inference, please! Even when compilers can decide whether or not there is that single assignable type! What I consider silly is to insist that readers infer the proper meaning of a sequence of digits when we can do better. Distillation of source code should mean: - to produce a fine executable, not - to produce the smallest element from the set of technically equivalent source texts of varying lengths. > The proper way to do this is: > > UTF8_Pi : constant String := Image (16#0C30#); How is that different from UTF8_Pi : constant String := U+16#0C30; Apart from using the relatively unspecific name Image, which conventionally refers to a "default print image" of a type, frequently used in trace based debugging?