|
|||
|
hey,
i'm trying to figure out a way to create diffs between lists .. diffs that represent what one would need to do to go from old-list to new-list wrt. operations (move, append, prepend, insert, remove) .. but maybe something already exists out there? i'm doing UI type stuff .. say i'm removing something from a list, then i insert it back at another place .. the "diff" in this case should yield a move instead of a remove and an insert (lisp list <-> "ui container") the idea is to enable one to use normal lisp list functions on "ui container widgets" .. i'm thinking something like: (with-bulk-update-of (some-container) ...) ...and, yeah, before vs. after -- something like that.. ...done before in some way? |
|
|
||||
|
||||
|
|
|
|||
|
Lars Rune Nøstdal <larsnostdal@gmail.com> writes:
> hey, > i'm trying to figure out a way to create diffs between lists .. diffs > that represent what one would need to do to go from old-list to new-list > wrt. operations (move, append, prepend, insert, remove) .. but maybe > something already exists out there? > > i'm doing UI type stuff .. say i'm removing something from a list, then > i insert it back at another place .. the "diff" in this case should > yield a move instead of a remove and an insert Are you sure it was a move? Perhaps it was a remove of the elements before, and an insert of the removed elements after? (a b c d e f) -> (a d e b c f) may have been obtained either as: (a b c d e f) -> (a c d e f) -> (a d e f) -> (a d e c f) -> (a d e b c f) or: (a b c d e f) -> (a b c e f) -> (a b c f) -> (a e b c f) -> (a d e b c f) or a few other ways... I'll just give you the difference, and let you use them as you want: C/USER[40]> (COM.INFORMATIMAGO.COMMON-LISP.LIST:TREE-DIFFERENCE '(a (b nil d) (b c) (d e f) g h) '(a (b w d) (b c x) (d e y) g h)) (= (= (/= NIL W) = . =) (= = /= NIL (X)) (= = (/= F Y) . =) = = . =) -- __Pascal Bourguignon__ http://www.informatimago.com/ "I have challenged the entire quality assurance team to a Bat-Leth contest. They will not concern us again." |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: SAS macro: is there a function to return the number of items | Joe Whitehurst | Newsgroup comp.soft-sys.sas | 0 | 04-17-2008 04:20 AM |
| Re: SAS macro: is there a function to return the number of items | toby dunn | Newsgroup comp.soft-sys.sas | 0 | 04-16-2008 09:24 PM |
| Re: tip: list processing: SQL into list or call execute | Fehd, Ronald J. | Newsgroup comp.soft-sys.sas | 0 | 02-27-2008 12:56 PM |
| Re: list processing: SQL into list or call execute | Mike Rhoads | Newsgroup comp.soft-sys.sas | 0 | 02-26-2008 07:13 PM |
| tip: list processing: SQL into list or call execute | Fehd, Ronald J. | Newsgroup comp.soft-sys.sas | 0 | 02-26-2008 01:42 PM |