Subject: Re: XML->sexpr ideas From: Erik Naggum <email@example.com> Date: 20 Jan 2004 04:08:55 +0000 Newsgroups: comp.lang.lisp Message-ID: <3283560535880752KL2065E@naggum.no> * Kenny Tilton | First, thx, <<quad>>s are nice. Heh. My absence from news shows. Over here in Europe, «» are the proper quotation marks, instead of the various versions of " that are not in ISO 8859-1. The « and » are not integral to the name of the type, it's just "quad". | I was thinking about compiling some XML-alternative syntax into | internal Lisp structures (which is why I was wondering why I even need | someone else's proposal, I can just write the internal structures out | as READable forms). You always have to consider how much information you want to retain from the parsing process. The sexpr contains just enough information for its uses, but the only navigation you ever do with sexprs is to go down the CAR or CDR. | I see <<quads>> are something that allow one to navigate the structure | itself, and that this is useful if one does not want to gobble up the | whole of the structure. Hm, I think it makes most sense when you do want to gobble up the whole of the structure. The point about storing pointers to entity fragments using quads, too, was that contents usually dwarfs the markup in volume. When end-tags make up 25% of the volume of the document, however, the start-tags make up another 25%, and when I designed the quad and its various implementations in Common Lisp and in special languages, the strong desire was to be able to load large documents into memory. | I'll keep <<quad>>s in mind if I ever want a random-access markup | store. That seems like you decided on their utility before trying them out, while I have really tried to build a system as useful for XML-like data as the cons cell is for Lisp-like data. Instead of inventing the array and regarding cons cells as random access into the list, we just use lists made up cons cells because that affords the navigation we need when processing them. Likewise, the quad affords the navigation we need when processing XML-like structures. When I suggest that an implementation that does not provide the ability to add native types use a two-dimensional array, it is not because it makes random access into the document possible but because it saves a lot of memory. -- Erik Naggum | Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.