From: Karel Miklav <karel@inetis.spppambait.com>
Subject: Re: calenday (was Re: IBM Acquires Rational Ada
Date: Wed, 18 Dec 2002 15:23:24 +0100
Date: 2002-12-18T15:23:24+01:00 [thread overview]
Message-ID: <wx%L9.1704$tQ1.102026@news.siol.net> (raw)
In-Reply-To: <mailman.1040104502.11594.comp.lang.ada@ada.eu.org>
Is there a package or something to work with locales in Ada (like in C,
you know :) )?
Grein, Christoph wrote:
> RM 13.4(8) For nonboolean enumeration types, if the coding is not specified for
> the type, then for each value of the type, the internal code shall be equal to
> its position number.
>
> So your proposal is superfluous.
>
> And there is no global agreement whether the week starts with Sunday or Monday.
> Historically, it starts with Sunday, but there are countries where it starts
> with Monday.
>
>
>>>>>type day_name_type is (mon,tue,wed,thu,fri,sat,sun);
>>>>>
>>>>>Add a representation clause to guarantee that the values
>>>>>start with sun => 0, mon => 1 etc. For some code, it is
>>>>>much easier to work with the day of the week in the form
>>>>>of a number.
>>>>
>>>>I'm puzzled by this advice.
>>>>
>>>>day_name_type'Pos(mon) .. day_name_type'Pos(sun)
>>>>
>>>>is necessarily 0 .. 6, is it not?
>>>>
>>>
>>>Yes, the _pos_ attribute is defined by the language as you state,
>>>but Warren is looking to have the _representation_ specified in
>>>the package specification. This insures that instantiations of
>>>Ada.Unchecked_Conversion between day_name_type and
>>>integer types produce specified results.
>>>
>>
>>Yes, but if what you want is "to work with the day of the week in
>>the form of a number", why use Unchecked_Conversion when
>>day_name_type'Pos does what you want without further ado?
next prev parent reply other threads:[~2002-12-18 14:23 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-17 5:47 calenday (was Re: IBM Acquires Rational Ada Grein, Christoph
2002-12-17 14:43 ` Robert A Duff
2002-12-17 21:35 ` Wes Groleau
2002-12-18 2:09 ` Robert A Duff
2002-12-18 6:32 ` Dennis Lee Bieber
2002-12-18 18:33 ` Wes Groleau
2002-12-18 21:04 ` Larry Kilgallen
2002-12-18 9:10 ` Anders Wirzenius
2002-12-17 20:48 ` Dennis Lee Bieber
2002-12-18 14:52 ` Ted Dennison
2002-12-18 20:19 ` Dennis Lee Bieber
2002-12-18 14:23 ` Karel Miklav [this message]
2003-01-05 17:05 ` Locale package (Was: calenday) Jacob Sparre Andersen
-- strict thread matches above, loose matches on Subject: below --
2002-12-18 7:52 calenday (was Re: IBM Acquires Rational Ada Grein, Christoph
2002-12-18 7:39 Grein, Christoph
2002-12-18 6:05 Grein, Christoph
2002-12-18 5:58 Grein, Christoph
2002-12-18 15:06 ` Robert A Duff
2002-12-18 20:09 ` Dennis Lee Bieber
2002-12-18 23:57 ` Torsten Poulin
2002-12-19 9:20 ` Anders Wirzenius
2002-12-19 15:33 ` Juanma Barranquero
2002-12-23 2:12 ` AG
2002-12-18 20:57 ` Dale Stanbrough
2002-12-17 5:51 Grein, Christoph
2002-12-17 14:50 ` Robert A Duff
2002-12-07 2:47 Richard Riehle
2002-12-09 13:09 ` Marin David Condic
2002-12-09 22:45 ` steve_H
2002-12-10 13:50 ` Marin David Condic
2002-12-10 17:47 ` Warren W. Gay VE3WWG
2002-12-10 20:21 ` Wes Groleau
2002-12-10 22:05 ` Warren W. Gay VE3WWG
2002-12-11 2:50 ` steve_H
2002-12-11 13:45 ` Marin David Condic
2002-12-11 14:46 ` Wes Groleau
2002-12-12 13:07 ` Marin David Condic
2002-12-12 18:19 ` Warren W. Gay VE3WWG
2002-12-16 10:11 ` calenday (was " Peter Hermann
2002-12-16 18:38 ` Warren W. Gay VE3WWG
2002-12-16 19:04 ` Bill Findlay
2002-12-16 20:25 ` David C. Hoos
2002-12-16 20:37 ` Bill Findlay
2002-12-16 21:41 ` David C. Hoos
2002-12-16 22:11 ` Bill Findlay
2002-12-17 15:47 ` Warren W. Gay VE3WWG
2002-12-17 16:26 ` Peter Hermann
2002-12-17 16:37 ` Bill Findlay
2002-12-16 22:32 ` tmoran
2002-12-16 22:21 ` Hyman Rosen
2002-12-17 8:07 ` Simon Wright
2002-12-19 12:23 ` Frank Piron
2002-12-19 12:33 ` Karel Miklav
2002-12-19 13:24 ` Marin David Condic
2002-12-17 14:46 ` Robert A Duff
2002-12-17 19:08 ` tmoran
2002-12-17 19:15 ` Bill Findlay
2002-12-17 20:00 ` Hyman Rosen
2002-12-17 19:48 ` Larry Kilgallen
2002-12-17 20:08 ` David C. Hoos
2002-12-17 20:52 ` Dennis Lee Bieber
2002-12-17 21:43 ` Steven Murdoch
2002-12-17 16:39 ` Robert A Duff
[not found] ` <atk8s0$7dm$1@news.uni <wccn0n4oazy.fsf@shell01.TheWorld.com>
2002-12-18 13:20 ` Marin David Condic
2002-12-18 15:17 ` Robert A Duff
2002-12-18 17:58 ` Marin David Condic
2002-12-19 8:48 ` tmoran
2002-12-19 13:18 ` Marin David Condic
2002-12-19 20:46 ` Randy Brukardt
2002-12-20 12:23 ` Larry Kilgallen
2002-12-20 21:35 ` Randy Brukardt
2002-12-20 13:15 ` Marin David Condic
2002-12-20 12:19 ` Larry Kilgallen
2002-12-21 15:48 ` Marin David Condic
2002-12-21 14:54 ` Larry Kilgallen
2002-12-20 18:49 ` Hyman Rosen
2002-12-20 19:48 ` Frank J. Lhota
2002-12-20 21:29 ` Randy Brukardt
2002-12-23 2:05 ` AG
2002-12-27 20:43 ` Randy Brukardt
2002-12-21 15:59 ` Marin David Condic
2002-12-20 21:49 ` Randy Brukardt
2002-12-18 18:57 ` Robert A Duff
[not found] ` <atk8s0$7dm$1@news.uni <wcc4r9b40ka.fsf@shell01.TheWorld.com>
2002-12-18 19:16 ` Warren W. Gay VE3WWG
2002-12-18 22:03 ` Randy Brukardt
2002-12-18 22:00 ` Randy Brukardt
2002-12-18 22:39 ` Robert A Duff
2002-12-19 2:41 ` Marin David Condic
2002-12-19 11:47 ` Larry Kilgallen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox