From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Practicalities of Ada for app development
Date: Tue, 12 Jun 2012 13:44:17 +0200
Date: 2012-06-12T13:44:17+02:00 [thread overview]
Message-ID: <yjoi3exq7rb8$.1djz4doucoy5m.dlg@40tude.net> (raw)
In-Reply-To: 4fd7107a$0$9504$9b4e6d93@newsspool1.arcor-online.net
On Tue, 12 Jun 2012 11:48:43 +0200, Georg Bauhaus wrote:
> 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.
Sorry for the reader, but numeric literal is just that: a 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.
It is very difficult if possible to create dimensioned fixed-point system
due to problems of handling accuracy. Note that the point of using fixed
point is to keep results exact.
>> 2. You cannot multiply time, you do durations (time intervals);
>
> Like in "two times"? "Time after Time"? "Many times"?
The thing represented by Ada.Calendar.Time or Ada.Real_Time.Time has no
dimension. You can multiply durations by themselves and by other
dimensioned values and scalars. Times can be subtracted. Duration can be
added to time.
>> 3. "s" or "second" is the proper name of the unit.
>
> "Seconds" is the plural of a "second" (one unit of time).
http://physics.nist.gov/cuu/Units/units.html
> "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?
"m" is meter. Minute is not a SI unit. Yes, there are many conflicting
names when irregular or units outside SI are involved.
As for conflicts with names of variables, that is not a problem in Ada.
>> 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.)
Yes, but C is where the ears are growing from.
If you want to follow the notation, you should to do it exactly, i.e.
U+0C20, without dashes around the number. If you don't, then use the most
appropriate way from the implementation language perspective. The middle
way would bring nothing but confusion.
>> 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.
Sorry, but the program as a whole is not what it means. You have to
interpret the program in order to understand its semantics. A good language
design is to support trivial inference and require complex things explicit.
Type annotation of operands of an expression *is* trivial, or else the
program is poorly designed.
>> 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;
Compare:
Image (16#0C30#) * 3
and
U+16#0C30# * 3
Anyway, if U+n notation support seem the only problem with Ada UTF-8, I
gather that the issue is closed. (:-))
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2012-06-14 19:15 UTC|newest]
Thread overview: 112+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 20:48 Practicalities of Ada for app development wrp
2012-06-08 21:35 ` Jeffrey Carter
2012-06-09 0:40 ` Adam Beneschan
2012-06-09 6:38 ` Jeffrey Carter
2012-06-21 17:14 ` Randy Brukardt
2012-06-21 18:16 ` Adam Beneschan
2012-06-21 19:18 ` J-P. Rosen
2012-06-21 20:30 ` Adam Beneschan
2012-06-21 21:09 ` Randy Brukardt
2012-06-22 4:59 ` Simon Wright
2012-06-22 5:32 ` Tero Koskinen
2012-06-22 19:51 ` Randy Brukardt
2012-06-21 21:15 ` J-P. Rosen
2012-06-22 10:43 ` Tero Koskinen
2012-06-21 21:00 ` Randy Brukardt
2012-06-21 21:18 ` J-P. Rosen
2012-06-22 19:55 ` Randy Brukardt
2012-06-23 6:43 ` J-P. Rosen
2012-06-09 4:30 ` BrianG
2012-06-09 7:11 ` Georg Bauhaus
2012-06-13 10:20 ` quiet_lad
2012-06-09 6:55 ` gautier_niouzes
2012-06-09 7:04 ` Georg Bauhaus
2012-06-09 9:25 ` Nomen Nescio
2012-06-09 9:36 ` Dmitry A. Kazakov
2012-06-10 3:46 ` Yannick Duchêne (Hibou57)
2012-06-12 20:10 ` i3text
2012-06-13 7:55 ` Dmitry A. Kazakov
2012-06-21 17:21 ` Randy Brukardt
2012-06-13 10:28 ` quiet_lad
2012-06-13 13:07 ` Dmitry A. Kazakov
2012-06-09 16:09 ` tmoran
2012-06-13 10:29 ` quiet_lad
2012-06-09 23:18 ` darkestkhan
2012-06-10 3:56 ` Yannick Duchêne (Hibou57)
2012-06-10 14:04 ` Dmitry A. Kazakov
2012-06-10 16:51 ` Yannick Duchêne (Hibou57)
2012-06-10 17:00 ` Dmitry A. Kazakov
2012-06-10 17:18 ` Yannick Duchêne (Hibou57)
2012-06-10 19:33 ` Dmitry A. Kazakov
2012-06-10 21:36 ` Nomen Nescio
2012-06-11 8:22 ` Dmitry A. Kazakov
2012-06-11 14:27 ` Georg Bauhaus
2012-06-11 14:43 ` Dmitry A. Kazakov
2012-06-11 16:19 ` Jacob Sparre Andersen
2012-06-11 18:38 ` Dmitry A. Kazakov
2012-06-11 17:14 ` Georg Bauhaus
2012-06-11 18:38 ` Dmitry A. Kazakov
2012-06-11 20:50 ` Georg Bauhaus
2012-06-11 21:43 ` Yannick Duchêne (Hibou57)
2012-06-12 7:55 ` Dmitry A. Kazakov
2012-06-12 9:48 ` Georg Bauhaus
2012-06-12 11:44 ` Dmitry A. Kazakov [this message]
2012-06-12 12:17 ` Georg Bauhaus
2012-06-12 12:18 ` Dmitry A. Kazakov
2012-06-11 18:29 ` Adam Beneschan
2012-06-11 19:16 ` Jeffrey Carter
2012-06-11 21:47 ` Yannick Duchêne (Hibou57)
2012-06-21 17:39 ` Randy Brukardt
2012-06-21 17:34 ` Randy Brukardt
2012-06-10 18:15 ` darkestkhan
2012-06-10 19:25 ` Dmitry A. Kazakov
2012-06-11 6:34 ` Jacob Sparre Andersen
2012-06-21 17:41 ` Randy Brukardt
2012-06-10 15:49 ` Shark8
2012-06-10 17:04 ` Yannick Duchêne (Hibou57)
2012-06-10 19:47 ` Dmitry A. Kazakov
2012-06-11 0:37 ` Nasser M. Abbasi
2012-06-11 8:37 ` Dmitry A. Kazakov
2012-06-12 6:24 ` Yannick Duchêne (Hibou57)
2012-06-12 7:59 ` Dmitry A. Kazakov
2012-06-13 10:35 ` quiet_lad
2012-06-13 13:09 ` Dmitry A. Kazakov
2012-06-14 3:21 ` quiet_lad
2012-06-14 7:58 ` Dmitry A. Kazakov
2012-06-14 8:39 ` Yannick Duchêne (Hibou57)
2012-06-14 9:26 ` Dmitry A. Kazakov
2012-06-21 17:51 ` Randy Brukardt
2012-06-11 0:00 ` Nasser M. Abbasi
2012-06-11 3:23 ` Jeffrey Carter
2012-06-11 21:10 ` Nomen Nescio
2012-06-11 21:55 ` Adam Beneschan
2012-06-12 8:07 ` Nomen Nescio
2012-06-12 15:28 ` Fritz Wuehler
2012-06-12 21:34 ` Nomen Nescio
2012-06-14 11:12 ` Nomen Nescio
2012-06-21 18:01 ` Randy Brukardt
2012-06-12 21:12 ` Nomen Nescio
2012-06-13 0:04 ` Adam Beneschan
2012-06-13 3:04 ` Shark8
2012-06-13 8:21 ` Dmitry A. Kazakov
2012-06-13 18:21 ` Shark8
2012-06-13 19:11 ` Dmitry A. Kazakov
2012-06-13 22:01 ` Yannick Duchêne (Hibou57)
2012-06-14 8:02 ` Dmitry A. Kazakov
2012-06-14 9:10 ` Yannick Duchêne (Hibou57)
2012-06-14 9:33 ` Dmitry A. Kazakov
2012-06-21 18:10 ` Randy Brukardt
2012-06-13 8:35 ` Yannick Duchêne (Hibou57)
2012-06-13 8:37 ` Georg Bauhaus
2012-06-13 10:14 ` Georg Bauhaus
2012-06-11 22:49 ` Jeffrey Carter
2012-06-13 10:31 ` quiet_lad
2012-06-13 12:57 ` Maciej Sobczak
2012-06-14 4:18 ` quiet_lad
2012-06-14 7:35 ` Ludovic Brenta
2012-06-14 10:02 ` Georg Bauhaus
2012-06-12 19:17 ` i3text
2012-06-12 19:52 ` Vadim Godunko
2012-06-27 18:39 ` Eryndlia Mavourneen
2012-06-27 18:46 ` Eryndlia Mavourneen
2012-06-28 13:23 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox