ported sexp-diff from chicken
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
sexp-diff
test-suite
tests
README.org
run-test

README.org

SEXP-DIFF

“sexp-diff” computes a diff between two s-expressions which minimizes the number of atoms in the result tree, also counting edit conditionals #:new, #:old.

Examples:

Also see “tests/sexp-diff-test-suite.scm”

The code:

(sexp-diff
   '(DEFUN F (X) (+ (* X 2) 1))
   '(DEFUN F (X) (- (* X 2) 3 1)))

should return

((DEFUN F (X) (#:new - #:old + (* X 2) #:new 3 1)))

The code:

(sexp-diff
   '(DEFUN F (X) (+ (* X 2) 4 1))
   '(DEFUN F (X) (- (* X 2) 5 3 1)))

should return

((DEFUN F (X) (#:new - #:old + (* X 2) #:new 5 #:new 3 #:old 4 1)))

The code:

(sexp-diff
   '(DEFUN F (X) (+ (* X 2) 4 4 1))
   '(DEFUN F (X) (- (* X 2) 5 5 3 1)))

should return

((DEFUN F (X) #:new (- (* X 2) 5 5 3 1) #:old (+ (* X 2) 4 4 1)))

Licenses

Ported from chicken/sexp-diff.scm

The sexp-diff/diff.scm is public domain, others are LGPL.