Open phmarek opened 6 years ago
Thanks for trying it out! I haven't used this lately and was just cleaning it up.
Looks like this is a bug actually, for when the sequences are strings. I think I have a partial fix that I'm about to push. The fix will cause it to not error, but the printed diff still won't be useful to you. The print-diff function capitalizes the string elements to indicate a substitution, but that's not meaningful for numeric elements. So the diff of "foo1" and "foo2" is:
NIL: #\f #\o #\o #\1
NIL: #\f #\o #\o #\2
Insertions and deletions are visible:
NIL: #\f #\o #\o #\1
NIL: #\f #\o #\o ***
Non-numeric substitutions are visible, e.g. "Fool" vs. "Food":
NIL: #\f #\o #\o #\L
NIL: #\f #\o #\o #\D
Let me know if that helps for now.
In the meantime, I'll have to figure out a better way to show the errors, perhaps ANSI colors is one option.
Well, ANSI colors aren't that easy to handle across the REPL; you could try to send them like this:
`( #\f #\o #\o '#\1)
`( #\f #\o #\o '#\2)
Ie. return two values, and highlight differences in them via (single)quoting, to have the syntax coloring do the work for you.
That's an interesting idea. I'll have to give it a little thought. In the meantime, anyone could write their own print function using the return value of diff
.
Hi,
first of all, thank you for this library!
Sadly it doesn't seem to work as expected, or at least as expected by me (sorry! ;).
PRINT-DIFFERENCES
saysGiven a 'path' as produced by the above function LEVENSTEIN-DISTANCE function above,
but trying to do that I get a type error:I guess I'm misunderstanding how that should be used, so perhaps the solution is a better doc-string?!