Plaster
New
List
Login
text
default
anonymous
2025.01.29 13:20:49
There are many potentially useful refactoring tools that could be built, some of which may exist in commercial CL implementations but are lacking in free CL implementations. - A significant missing piece is an editor that can determine the role of each symbol in a buffer. - Such a tool would enable more sophisticated refactoring operations, like renaming lexical variables correctly. - When you put the cursor on a lexical variable, or when you hover your pointer over it and you get all the usages of it highlighted, requires a compiler. (Not the same as M-. C-s which highlights based on text not meaning) Determining the role of each symbol in a file is a simple matter of applying the first phase of a compiler to it. The first phase of a compiler can be largely independent of the implementation, since the semantics of Common Lisp are documented. **Example from McCLIM:** (DEFMETHOD GRAFT ((GRAFT GRAFT)) GRAFT) There are three different meanings for GRAFT in that code: a class, a function, and a parameter. **Another example:** Suppose you have (LET ((X ...)) (MY-MACRO X ...)). There is no way to know whether the last X refers to the lexical variable without expanding MY-MACRO. Only a compiler can do that
Raw
Annotate
Repaste
Edit