Re:Erik Naggum on Attributes in SGML, XML, Lisp (2001)
by wodenokoto on Friday May 15, 2015 @09:56PM
(#9554718)
Why does everybody say it's lisp thing to save an expression to disc, or that "code is data in lisp" kind of things?
Every language I've ever used has variable assignment and you can write those to a document and execute it.
I was about halfway through writing the (write-to-xml) function when I realised I could just write the entire lisp expression to the file instead...
Not only was it smaller, it had the huge advantage of not needing to parse it back when I wanted to read from disk, I just called the inbuilt (read) function. Thankfully I only wasted an afternoon!
That's what really ingrained the whole "data is code, code is data" idea into me. I even went on to write the structure function to each file as well, so that no matter what I did to the data structure down the line, I would still have the actual code needed to understand it. Right next to the data itself. Not only was my code self-documenting, my data was as well ;)