comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: new revision ada (exception handling)
Date: Fri, 25 Jun 2004 10:05:17 +0200
Date: 2004-06-25T10:05:17+02:00	[thread overview]
Message-ID: <s1spuprxstn0$.11739hjwai5o4$.dlg@40tude.net> (raw)
In-Reply-To: XsmdnQNS8elg3kbdRVn-jg@megapath.net

On Thu, 24 Jun 2004 16:13:58 -0500, Randy Brukardt wrote:

> "Martin Krischik" <krischik@users.sourceforge.net> wrote in message
> news:1602287.U74iaLRb4H@linux1.krischik.com...
>> Randy Brukardt wrote:
> ...
>>> We considered it briefly, but there are a number of problems with such a
>>> feature. (One example is that Text_IO.Enumeration_IO depends on 'Image.
>>> How will it know what syntax to read for a user-defined image.) Anyway,
> we
>>> dropped the idea.
>>
>> At least for the first question I know the answer. It is the same as for
>> 'Output:
> 
> No, that's *not* the question. (That's another question, which also needs to
> be answered.)
> 
> The issue is that Enumeration_IO.Get needs to know the syntax of a
> enumeration literal in order to know when to stop reading. For instance, if
> a file has:
> 
> Red;Green Blue
> 
> and you do a Get, the next character to be read is ';', and "Red" will be
> passed to 'Image.
> 
> But if you allow a user-defined 'Image, you don't know what to read in order
> to pass it to 'Image. Perhaps the semicolon is part of the literal, perhaps
> it is not. Perhaps the case matters to the literal, and perhaps not. So
> where does reading stop? (And remember, whatever is done has to be
> compatible with existing code and files.)

One can build a table of all possible values of 'Image and use the table to
match the input. In this case there is no need to know where a name stops,
one only needs to have all names in the table different. However it looks
like the definition of Enumeration_IO.Get assumes that name ends can be
recognized prior knowing names, though A.10.10(9) does not read it
explicitly. Considering an enumeration type with images Red and Red1. Would
it be legal according to A.10.10(9) to read Red; and then raise Data_Error?

But of course the real source of the problems is that there is no S'Class
for enumeration types. Otherwise one could just deduce 'Input from 'Image
and use it Get.

-- 
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2004-06-25  8:05 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-31 13:32 Typing in Ada Empit
2004-05-31 14:04 ` Poul-Erik Andreasen
2004-05-31 17:01 ` Jeffrey Carter
2004-05-31 20:03   ` Peter C. Chapin
2004-05-31 22:56     ` tmoran
2004-06-01  1:09       ` Peter C. Chapin
2004-06-01  4:40         ` tmoran
2004-06-01 11:26           ` Peter C. Chapin
2004-06-10  3:01             ` Dave Thompson
2004-06-10  3:00         ` Dave Thompson
2004-05-31 23:22     ` Nick Roberts
2004-06-01  1:04       ` Peter C. Chapin
2004-06-01  2:29         ` Nick Roberts
2004-06-02  4:39         ` Robert I. Eachus
2004-06-02 15:17           ` Hyman Rosen
2004-06-01  2:36       ` Hyman Rosen
2004-06-01  4:27         ` Larry Kilgallen
2004-06-01  4:05           ` Hyman Rosen
     [not found]         ` <d4vnb0tepd4togdrvdrbqpok1ne6n9i2vp@4ax.com>
2004-06-01 14:36           ` Wes Groleau
2004-06-01 20:24         ` Niklas Holsti
2004-06-02  4:43           ` Wes Groleau
2004-06-02  5:28             ` Robert I. Eachus
2004-06-02  8:19               ` tmoran
2004-06-02 14:47               ` Wes Groleau
2004-06-02 11:26             ` Marin David Condic
2004-06-02 14:54               ` gratuitous restrictions (was:Typing in Ada) Wes Groleau
2004-06-02  5:04           ` Typing in Ada Robert I. Eachus
2004-06-01  2:14     ` David C. Hoos
2004-06-02  1:30     ` Jeffrey Carter
2004-06-02 10:53       ` Peter C. Chapin
2004-06-02 11:38         ` Marin David Condic
2004-06-17  2:50           ` Dave Thompson
2004-06-17  4:24             ` James Rogers
2004-06-17 12:28               ` Hyman Rosen
2004-06-17 23:42                 ` James Rogers
2004-06-20 11:27                   ` Nick Roberts
2004-06-20 23:29                     ` new revision ada Brian May
2004-06-21  2:16                       ` tmoran
2004-06-21  2:34                         ` James Rogers
2004-06-22  2:16                           ` Roland Illig
2004-06-22  3:41                             ` James Rogers
2004-06-22  6:53                               ` Martin Krischik
2004-06-21 23:33                         ` Brian May
2004-06-22 20:26                           ` Simon Wright
2004-06-23  0:50                             ` Larry Elmore
2004-06-22 22:06                           ` tmoran
2004-06-21  5:31                       ` Wes Groleau
2004-06-21 12:27                       ` new revision ada (limited with, excpetion handling) Nick Roberts
2004-06-21 13:04                         ` Martin Dowie
2004-06-22 10:38                       ` new revision ada Georg Bauhaus
2004-06-22 12:45                         ` James Rogers
2004-06-22 15:17                           ` Martin Krischik
2004-06-22 16:09                             ` new revision ada (exception handling) Nick Roberts
2004-06-23  7:55                               ` Pascal Obry
2004-06-23  8:40                                 ` Martin Krischik
2004-06-23 19:33                                   ` Randy Brukardt
2004-06-24  6:57                                     ` Martin Krischik
2004-06-24 21:13                                       ` Randy Brukardt
2004-06-25  8:05                                         ` Dmitry A. Kazakov [this message]
2004-06-25 17:28                                           ` Randy Brukardt
2004-06-23  4:31                             ` new revision ada Brian May
2004-06-23 19:47                               ` Randy Brukardt
2004-06-22 16:37                           ` Georg Bauhaus
2004-06-26 14:57                           ` Robert I. Eachus
2004-06-01  1:02 ` Typing in Ada Alexander E. Kopilovich
  -- strict thread matches above, loose matches on Subject: below --
2004-06-25  9:48 new revision ada (exception handling) Christoph Karl Walter Grein
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox