This module provides a function to compute differences between two lists/arrays.
diff() compute the difference of the specified two sequences. The sequences can be either of the following types.
If String or File is specified as a parameter, the lines in the file are to be compared. If Reader or InputStram is specified, a collection of the lines is created first, then compared with the other parameter.
size() returns the number of chunks. 0 means no difference.
> r = diff([1,2,3], [1,3,4]) 2d1 < 2 3a3 > 4 > r.size() 2
patch() applies the patch to original to get revised.
> patch(r, [1,2,3]) [1, 3, 4]
parseDiff() parses a diff-formatted text reading from input, and returns the same type of object that diff() returns.
parseDiff("diff.txt")