From ... From: Erik Naggum Subject: Re: Q: parsing strings Date: 2000/10/10 Message-ID: <3180207722329732@naggum.net>#1/1 X-Deja-AN: 679931652 References: <8qt214$vu7$1@nnrp1.deja.com> <39E2BB4E.EB87BA62@onlinehome.de> <4lmvwvj6c.fsf@beta.franz.com> <39E3469B.C16D2AFC@sol-3.de> <39E371A1.5B9DCEE2@west.raytheon.com> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 971221512 20334 195.0.192.66 (10 Oct 2000 23:45:12 GMT) Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Mime-Version: 1.0 NNTP-Posting-Date: 10 Oct 2000 23:45:12 GMT Newsgroups: comp.lang.lisp * Raymond Laning | 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.