Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.lisp

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-15-2008, 07:01 AM
Lars Rune Nøstdal
Guest
 
Posts: n/a
Default old-list vs. new-list ==> diff wrt. operations

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?

Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 11-15-2008, 08:10 AM
Pascal J. Bourguignon
Guest
 
Posts: n/a
Default Re: old-list vs. new-list ==> diff wrt. operations

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."
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


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



All times are GMT. The time now is 10:03 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.