Thomas Huber <th0mas.hu...@googlemail.com> writes: > Hi Phil, thanks for your reply. > > The source data structure doesn't have to contain only "bare" source code. > It could contain everything that is in a text file, but just saved in a > structured way.
To contain "everything", then the data model needs to be rich enough, for instance to represent indentation. Ultimately, I would be interested in seeing what the data model for this would look like; for comments, I suspect, it would be 'at position 1 we have "a"; at position 2 we have "b"'. And data that is stored in a structure, needs to obey that structure all of the time. With Clojure: (println "hello" of course, does not obey the structural requirements of the clojure language. So, then, how do I type this? Which I might want to, until I have finished. The question is not about structured/unstructured representation. My text editor is *already* structured. I use emacs, you can go and read the source code if you want, but it has data structures which represents buffers and strings. And more over, at my option, when I choose, I can apply a high level structuring over this data -- that is, I can eval in Clojure. So, the question is, can you come up with a better data structure than the one we have already? Or is a simple string representation enough. Incidentally, if you think structured editing is good, do you remember the Sinclair Spectrum keyboard which meant that you could only enter valid tokens. How cool was that? Structured editing at it's finest. > The data needs to be "compiled" to bytecode anyway. But not continually. Only when I ask it to. > I'm not sure if diffing is a huge problem. You can still pretty print you > source data and save it into a text file. > Diffing these files should be enough to get an idea what was changed. > And if not a special diffing tool would have other advantages to I think. And one huge disadvantage. You would have to write it. > > Finally, source code is often wrong, or a work in progress. Okay, with >> paredit, Clojure can be mostly kept correct (syntactically) most of the >> time, but lisp is the oddity, and you need all the brackets to enable >> this. Even with paredit, for me, editing in this way fails often enough >> for me, that I wrote something to switch paredit off rapidly, and then >> back on again when I've fixed it. > > > You can still save your programm as a data structure even if its wrong. Or > am I missing your point? Nope. You can only save your program in a data structure, if it obeys that data structure. All of the advantages that you think are going to come, happen as a result of having a data structure which enforces correctness. So, you cannot put an incorrect program into the data structure, unless you have a generic data structure which looks like a sequence of characters. Which you already have. Phil -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.