Subject: Re: Q: parsing strings From: Erik Naggum <email@example.com> Date: 2000/10/10 Newsgroups: comp.lang.lisp Message-ID: <firstname.lastname@example.org> * Raymond Laning <email@example.com> | the people responding to your postings evidently never had to deal | with integrating legacy (e.g. paleolithic) systems. Or that's just what they had, but they did it the right way. | I had to write a formatted-read function to read output from fortran | programs that could not be maintained because the people that wrote | them were no longer employed (or in some cases, living). I am sorry | that the sourcecode for my function is no longer available to me | else I would pass it along, but IIRC it had many similarities to | yours Then there's no wonder you, too, feel that legacy systems are painful and that the right solution lies in simple-minded but overly powerful tools like regular expressions and simple-minded parsers. Actually _understanding_ a legacy data format is not easy, as most of the people who write their own data formats are incredibly stupid and short-sighted (as in writing years with two digits), and you're trying to use all your brainpower to be as dumb as someone who didn't have a clue that someday someone would have to think like they did, because they didn't think at all. Clearly, a regular expression or something like "scanf" can't hack this -- both are rife with the same kind of short-sightedness that produce such random results. Hoping for a match between the outcomes of two random processes is just insane. Writing an input processor ("reader") for some foreign language or data format is not something you do by reversing "format". Hell, you don't _use_ format to produce syntactically correct output in other syntaxes, either. format is meant for _human_ consumption. Some day, programmers will understand that there are three ways to represent information: computer-to-human, human-to-computer, and computer-to-computer; they have exactly _nothing_ in common which you can use to deal with another when you have dealt with one. Tools that seem to work most of the time (perl), or that promise something they cannot possibly deliver (XML), will only delay it. #:Erik -- If this is not what you expected, please alter your expectations.