2011/11/7 Joost <[email protected]>

> On Nov 4, 4:07 pm, Chas Emerick <[email protected]> wrote:
>
> > I've only looked at the code for ~5 minutes, but I think I might
> understand what's going on.  To confirm: clojure-refactoring is sending
> something like diffs back to the refactoring-mode/SLIME, and that
> mode/emacs is what is actually performing the modifications to affected
> files?
>
> Basically, what's happening is that the emacs code sends snippets of
> code + some argument to the clojure backend, and gets a new snippet
> back replacing the old one.
>
> For instance, extract-fn gets called with a string representing the
> original function, another string representing the expression to
> extract and a function name, and it returns a string representing the
> extracted function + the original function with the expression
> replaced by a call to the new function.
>
> Similar things happen with the threading functions and rename. The
> emacs side of things pretty much consists of selecting, replacing and
> re-indenting expressions.
>
>
>
> On Nov 4, 4:30 pm, Laurent PETIT <[email protected]> wrote:
> > Hello,
> >
> > As far as I remember, clojure-refactoring considered (or is using ?)
> > using parsley + the clojure grammar in paredit.clj for some (all ?) of
> > its refactorings.
> >
> > What is the current status of this ? (I also have a long delayed todo
> > list note on adding refactoring to CCW, for sure ! :-) )
>
> clojure-refactoring currently doesn't use paredit.clj at all, it still
> has its own parsley clojure grammar in clojure-
> refactoring.support.parser
>

OK, so it's already using parsley, good. My guess is that what served as a
base for clojure-refactoring's parsley grammar is a old version of
paredit's grammar. Probably the two of them have diverged since then.

>
> I haven't looked at paredit's grammar. it may be useful to use that,
> especially if we can have some common higher-level operations on
> parsed clojure trees (simple things like "find the argument list for
> this function" etc), but I just haven't had the time to look into it.
>

Indeed. I've still some important things to do on CCW before starting more
advanced features such as refactoring, but it's definitely on my todo list
to work on this. The challenge will be to nicely integrate with the
refactoring framework of Eclipse (which decomposes things in steps: first a
graphical preview of the changes -potentially on multiple files, depending
on the refactoring-, then application of the changes if the user accepts)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to