comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Data_Error and Enumeration_IO
Date: Sat, 14 Jan 2012 10:51:06 +0100
Date: 2012-01-14T10:51:06+01:00	[thread overview]
Message-ID: <1gv8onztmplct$.1plcq438hgmof$.dlg@40tude.net> (raw)
In-Reply-To: jeqh4g$peo$1@munin.nbi.dk

On Fri, 13 Jan 2012 18:09:48 -0600, Randy Brukardt wrote:

> As to why it is done this way, it's hard to imagine how else it could be 
> done. To reject the "abc" example at the 'a', for instance, we would have to 
> do a brute force search in a table of potentially hundreds of enumeration 
> literals to see if any start with 'a', then repeat that to see if any start 
> with "ab", and so on. If the literals are long and the number of literals is 
> high, this is going to be a N**2 algorithm -- and I don't think I want my 
> input to do that (there is a built-in denial of service possibility).

You have the enumeration type when you are reading its literal. The actual
problem is looking ahead or returning an unbounded number of characters
back. The advantage of using strings is that you can easily maintain the
policy that on any error the cursor is not moved.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-01-14  9:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 22:41 Data_Error and Enumeration_IO John McCormick
2012-01-12 23:02 ` Jeffrey Carter
2012-01-12 23:28 ` Georg Bauhaus
2012-01-13  0:10 ` Randy Brukardt
2012-01-13  8:33   ` Dmitry A. Kazakov
2012-01-13 21:30   ` John McCormick
2012-01-13 22:00     ` Jeffrey Carter
2012-01-14  0:09       ` Randy Brukardt
2012-01-14  9:51         ` Dmitry A. Kazakov [this message]
2012-01-14 12:25         ` Niklas Holsti
replies disabled

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