You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to create edit scripts for Clojure code patches. Would it be feasible to add operations for structural editing? I'm thinking mainly about the following ones, tho there are some others.
wrap: expr -> (expr)
raise: (foo expr bar) -> expr
slurp: (foo) expr -> (foo expr)
barf: (foo expr) -> (foo) expr
Each could work for vectors and sets as well.
Example:
(e/diff
'(do
(let [a 6])
(+ a 9))
'(do
(let [a 6]
(+ a 10))))
-> [[[12] :+ (+ a 10)]
[[2] :-]]
Our current definition of diff size is the number of nodes in the diff data structure. The structural editing examples you show above do not actually reduce the diff size, but increase them.
Hey, great library, thanks for your work!
I'd like to create edit scripts for Clojure code patches. Would it be feasible to add operations for structural editing? I'm thinking mainly about the following ones, tho there are some others.
expr
->(expr)
(foo expr bar)
->expr
(foo) expr
->(foo expr)
(foo expr)
->(foo) expr
Each could work for vectors and sets as well.
Example:
would result in a cheaper sequence of operations:
Another example:
would become something like
The text was updated successfully, but these errors were encountered: