1. sexp-diff
    1. Introduction
    2. Documentation
    3. Examples
    4. Authors
    5. License
    6. History

sexp-diff

Introduction

Diffs s-expressions based on Levenshtein-like edit distance.

Documentation

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

Examples

 (sexp-diff
  '(DEFUN F (X) (+ (* X 2) 1)) 
  '(DEFUN F (X) (- (* X 2) 3 1)))
 
 ==>
 
 ((DEFUN F (X) (#:new - #:old + (* X 2) #:new 3 1)))
 (sexp-diff
  '(DEFUN F (X) (+ (* X 2) 4 1))
  '(DEFUN F (X) (- (* X 2) 5 3 1)))
 
 ==>
 
 ((DEFUN F (X) (#:new - #:old + (* X 2) #:new 5 #:new 3 #:old 4 1)))
 (sexp-diff
  '(DEFUN F (X) (+ (* X 2) 4 4 1))
  '(DEFUN F (X) (- (* X 2) 5 5 3 1)))
 
 ==>
 
 ((DEFUN F (X) (#:new - #:old + (* X 2) #:new 5 #:new 5 #:new 3 #:old 4 #:old 4 1)))

Authors

Michael Weber, ported to racket by Vincent St-Amour, ported to CHICKEN by felix winkelmann.

License

LGPL

History