Actually, the observation below might be really good news. Does it means that all references are resolved at compile time? Do I ever have to run the code to figure out the context of a reference? Or, does the lexical context give me all the information I need?
I have already reimplemented the Clojure parser to do the syntax checking, folding and brace matching. Reimplementing references might not be so bad. In brief, I parse the Clojure program into a tree structure (of course). Defs, defns, lets etc are all nodes on this tree. Symbols are leafs. The nodes in the tree are sorted by the order the text appeared in the file. Used code from other files is treated as being textually inserted. Can I always resolve a reference by walking back up the tree. Walk back at the current level, if not found, go up a level and walk back, repeat. Thanks P > Remember, Clojure is a compiler, not an interpreter. The compiler > doesn't remember syntax. There is no "running image" in the Smalltalk > sense. > > So the 100% perfect refactoring you have in mind may not be possible > without reimplementing a large portion of Clojure itself. > > -Stuart Sierra > > > > --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---