Re: diff and patch

Liste des GroupesRevenir à cl tcl 
Sujet : Re: diff and patch
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tcl
Date : 17. Jun 2025, 23:36:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102sqm7$2lriu$1@dont-email.me>
References : 1
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
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

Date Sujet#  Auteur
17 Jun 25 * diff and patch8Mark Summerfield
17 Jun 25 +* Re: diff and patch3Arjen
17 Jun 25 i+- Re: diff and patch1Mark Summerfield
17 Jun 25 i`- Re: diff and patch1Mark Summerfield
17 Jun 25 `* Re: diff and patch4Rich
18 Jun 25  `* Re: diff and patch3Mark Summerfield
18 Jun 25   `* Re: diff and patch2Ashok
18 Jun 25    `- Re: diff and patch1Paul Obermeier

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal