Tk Library Source Code

View Ticket
Login
Ticket UUID: 708502
Title: Longest common subsequence of two lists
Type: Patch Version: None
Submitter: kennykb Created on: 2003-03-23 20:31:40
Subsystem: struct Assigned To: andreas_kupries
Priority: 7 High Severity:
Status: Closed Last Modified: 2008-12-04 07:47:50
Resolution: Accepted Closed By: andreas_kupries
    Closed on: 2003-04-02 07:48:39
Description:
The core of a differential file comparison program,
such as Unix 'diff', is the ability to compute or
approximate the longest common subsequence
of two lists. In response to requests from Pascal
Scheffers and Jean-Claude Wippler for a pure-Tcl
'diff' for wikit, I've developed Tcl code that implements
the Hunt-McIlroy algorithm for longest common
subsequence.

It strikes me that this fits the [chart of proposed
additional list functionality] that Andreas has
placed on the Wiki, and that a natural place to
put it in Tcllib would be as

     [::struct::list lcs $list1 $list2]

But of course, we don't have the ::struct::list
command yet, so I've no framework in which to
fit this.

I'm attaching source code, test suite, and a
draft manual page for the comparison code
to this article for your review.  I'm presuming
that it should fit nicely with feature request
# 577055. But I think that Andreas should
review it and commit if he approves, since he
seems to be the leader for this functionality.
User Comments: [email protected] added on 2008-12-04 07:47:50:
apple

andreas_kupries added on 2003-04-02 14:48:39:
Logged In: YES 
user_id=75003

Created subpackage struct::list in module struct of tcllib,
as per our discussion in the tcler's chat.

kennykb added on 2003-03-24 03:35:10:

File Added - 45770: list.test

Logged In: YES 
user_id=99768

Verified using TDK that list.test has full (line-based)
test coverage of the source code.

kennykb added on 2003-03-24 03:33:36:

File Added - 45769: list.man

kennykb added on 2003-03-24 03:33:34:

File Added - 45768: list.tcl

Attachments: