Deutsch   English   Français   Italiano  
<102sqm7$2lriu$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Rich <rich@example.invalid>
Newsgroups: comp.lang.tcl
Subject: Re: diff and patch
Date: Tue, 17 Jun 2025 22:36:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <102sqm7$2lriu$1@dont-email.me>
References: <102r7e7$28ndk$1@dont-email.me>
Injection-Date: Wed, 18 Jun 2025 00:36:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f4edd7f37a70f6d2682435f4029f1959";
	logging-data="2813534"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX192uwYyplBYv1K3I3zaz848"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:82ofOMaf4GzWo1rM3PWSUA4UBAI=

Mark Summerfield <m.n.summerfield@gmail.com> wrote:
> I want these functions:
> 
>     proc diff {old new} -> # diff data "ddata"
>     proc patch {old ddata} -> # new
> 
> where old and new are strings.
> 
> I thought the Tcllib's rcs module could do this but I can't figure it out.
> 
> Is this possible using the rcs module or using the struct::list module's 
> LCS functions?

The core of the diff algorithm is LCS.  You want the LCS functions from 
struct::list.

But, you don't get a "diff" from the LCS procs, you get the LCS data, 
you then have to convert that into a "diff" format of your choice.

You likely want to look at the various "diff in tcl" pages on the wiki.  
A starting point: https://wiki.tcl-lang.org/page/diff+in+Tcl