From ... From: Erik Naggum Subject: Re: Q: parsing strings Date: 2000/10/10 Message-ID: <3180205719547890@naggum.net>#1/1 X-Deja-AN: 679931638 References: <8qt214$vu7$1@nnrp1.deja.com> <39E2BB4E.EB87BA62@onlinehome.de> <8rufvp$crc$1@joe.rice.edu> <39E2DDCD.A8F8E749@sol-3.de> 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 * Marco Antoniotti | Yes. And in the most general case you must resolve to writing a | complex parser (which may rely on scanf) to handle the quirkiness of | the format. That is why XML is a step in the right direction. Bzzzt. Just Plain Wrong. XML does _exactly_ nothing to help this. It doesn't even _enable_ something that helps the situation. XML is just syntax for naming elements in a structure. That structure has a view, according to the granularity at which you want to process it. In Common Lisp, the Lisp reader increases the granularity to the object level. This is very good. This is in fact brilliant. XML does no such thing. XML only names the _strings_ that somehow make up the objects, the operative word being "somehow". How do you write a date in XML? I favor 2000-10-10. Others 20001010, and yet others prefer to omit the century (nothing learned from Y2K), write the date in human-friendly forms, or even using the names of the months, abbreviated, in local languages, misspelled. You can teach the Common Lisp reader to accept @2000-10-10 as a date object, and I have. It works like a charm. What does XML offer above and beyond specific object notations? And speaking of those "objects", XML is supposed object-oriented, but in reality, it's _only_ character-oriented, as in: no object in sight, as in: those who get the named strings (counting both elements and attributes) from XML need to parse them for their own contents -- because, and this surprises the XML people when the limitation of their bogus approach dawns on them, real data is _not_ made up of strings. Strings constitute _representations_ of the data, which must be parsed, checked for consistency and used to create objects, and if this sounds like we're back at square 1, that's exactly the case. XML is a giant step in no direction at all. If a syntax doesn't produce objects that may be manipulated as such, it's worthless. In the case of XML, it's a step in the right direction for all the hopeless twits who otherwise wouldn't have a job in the booming IT industry, for all those H1B visa applicants who would never have a chance to get out of their rotten, backward countries, etc, but as far as the information is concerned, our ability to read and write data consistently and portably, XML offers us exactly _nothing_, but carries huge expenses and causes investments and time to be diverted from every smarter solution, which could be a competitor... which is why such fine information custodians as Microsoft are adopting and embracing it. This is not to say that XML can't be used productively, but it isn't _XML_ that's doing it when it's done, it's the semantics you add to the syntax that does it, the objects that wind up in memory in some computer somewhere and which there exists code to manipulate. You can do that better, cheaper, faster, and even better standardized without XML than with XML. XML is a truly _magnificent_ waste. #:Erik -- If this is not what you expected, please alter your expectations.