Created
May 8, 2014 16:49
-
-
Save vseloved/5aba2ab2b1893a8fa0f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun am->br (am br amf) | |
(flet ((str->arr (str) | |
(make-array (length str) :initial-contents (coerce str 'list)))) | |
(with-accessors ((as diff:original-start) (al diff:original-length) | |
(bs diff:modified-start) (al diff:modified-length)) | |
(find (find-class 'diff:modified-diff-region) | |
(diff:compute-raw-diff (str->arr am) | |
(str->arr br)) | |
:key 'class-of) | |
(strcat (slice amf 0 as) | |
(slice br bs (+ bs bl)) | |
(slice amf (+ as al)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment