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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1901f265c928a511 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: new revision ada (exception handling) Date: Fri, 25 Jun 2004 10:05:17 +0200 Message-ID: References: <40BDBBFA.2020203@noplace.com> <1087475285.166449@master.nyc.kbcfp.com> <2jlepqF12qbb6U1@uni-berlin.de> <1774424.VSnnNmZCKX@linux1.krischik.com> <2jr3tjF149hg2U1@uni-berlin.de> <3596451.WJTNXepdF3@linux1.krischik.com> <4cWdnR6hNJN4R0TdRVn-hw@megapath.net> <1602287.U74iaLRb4H@linux1.krischik.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de d8ASSqzOj10fOaqYtju01AznkM+7bkM4xGmKKWcEju2vkLcww= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:1877 Date: 2004-06-25T10:05:17+02:00 List-Id: On Thu, 24 Jun 2004 16:13:58 -0500, Randy Brukardt wrote: > "Martin Krischik" 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