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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5c3042563529d4f3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.196.130 with SMTP id im2mr153701pbc.3.1326443631750; Fri, 13 Jan 2012 00:33:51 -0800 (PST) Path: lh20ni176776pbb.0!nntp.google.com!news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!46.17.56.130.MISMATCH!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Data_Error and Enumeration_IO Date: Fri, 13 Jan 2012 09:33:31 +0100 Organization: cbb software GmbH Message-ID: References: <3f3d626a-1b8c-49af-aa85-9e586029a817@z12g2000yqm.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-01-13T09:33:31+01:00 List-Id: On Thu, 12 Jan 2012 18:10:37 -0600, Randy Brukardt wrote: > My recommendation is always to read the input into a string and then process > it there (using the string Gets that the language provides). The reason for > this is that it always a better error message in the failure case, because > you still have the string in hand. That way, you can avoid a generic message > that puzzles the user. Another reason is that you can always return back in the string and re-parse improperly matched parts of it. > [Aside: For some reason, this reminds me of the first C compiler I used, way > back at the University of Wisconsin in 1978. It was a PDP-11 compiler for an > early version of Unix, and it essentially had two error messages: "lvalue > expected" for any compile-time mistake, and "bus error - core dumped" for > any run-time mistake. Debugging programs using that compiler were almost > completely trial-and-error - you would guess what the error might have been, > and try something else to see if it fixed it. The compiler, and the fact > that early PC compilers were very much like it, had a lot to do with our > creating Janus/Ada a couple of years later. And that is why we always had > runtime trace backs and verbose runtime messages from the very beginning...] Early Turbo Parscal compilers had only one to say "error in expression." But it is still sometimes a problem in C++ that the error message incomprehensible. Then I would use the same technique I did 25 years ago: comment everything out until it compiles and then uncomment line by line compiling it each time. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de