Newbie question on renaming

From: William Bland (news_at_abstractnonsense.com)
Date: 05/07/04


Date: Thu, 06 May 2004 22:57:52 GMT

Hi all,
        When I want to rename a variable in a statically typed language like
Java, I'm pretty lazy about it: I rename the variable where it's defined,
compile, and then change the name in all the places the compiler tells me
about. I like knowing that, if it compiled, I found all the places that
needed changing.

Of course I do much prefer dynamic typing, except that now I can't see an
easy way to rename things (search-and-replace doesn't work because I reuse
names sometimes, and often names are substrings of each other).

I guess this is the kind of thing that "refactoring browsers" are meant to
do (guessing because I've never used one). I wonder how hard it would be
to get Emacs to rename a variable, taking into account scope?

Since we have a built in "parser" in the form of READ one could, of
course, write a Lisp program that renames variables in other Lisp
programs... that's way above my newbie level of Lisp at the moment though.

Am I missing something simple? How do other people do this kind of thing?

Cheers,
        Bill.

-- 
Dr. William Bland.
It would not be too unfair to any language to refer to Java as a
stripped down Lisp or Smalltalk with a C syntax.   (Ken Anderson).


Relevant Pages

  • Re: Java versus Lisp. Comparison needed.
    ... The Java program turns out to be much slower than the Lisp ... times faster than Java (SBCL: 16 minutes; ... only if you run it long enough JVM will compile it. ...
    (comp.lang.lisp)
  • Re: Newbie question on renaming
    ... > Java, I'm pretty lazy about it: I rename the variable where it's defined, ... int doSomething() { ... life a bit easier in the Java world. ... with less variables in Lisp, and techniques, similar to those described by ...
    (comp.lang.lisp)
  • Re: Why Generics?
    ... > of not knowing the correct type at compile time, ... Java uses parameter-signature ... to do in Common Lisp. ... The real improvement needed in Java is keyword parameters, ...
    (comp.lang.java.programmer)
  • Re: Java versus Lisp. Comparison needed.
    ... The Java program turns out to be much slower than the Lisp ... times faster than Java (SBCL: 16 minutes; ... unlike SBCL it does not compile code by default, ...
    (comp.lang.lisp)
  • Re: Is anything easier to do in java than in lisp?
    ... > portable part of the core language, the LISP package, and the java.lang ... > javac or java takes appx. ... > You need to re-start java every time you want to compile and every time ... The only thing I can think of is networking. ...
    (comp.lang.lisp)