This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: (remove) doesn't work
> It looks to me like it would be pretty easy to modify the eval() function
> near line 1432 of lisp.c, where it calls remove_from_list(), to detect
> when the thing being removed is a list, and in that case iterate over it.
Yeah. The only thing that spring to my mind is whether xconq has
lists of lists, and whether you'd want
remove (c d) from (a b (c d) e) to return (a b e)
Off the top of my head I don't even remember whether xconq has lists
of lists, much less whether the above functionality is important.
> What concerns me is that this looks like the sort of thing that
> could have wacky side effects if modified, because even though the
> code looks straightforward right there, it seems to tie into LISP
> stuff that I don't understand.
I will point out that this kind of thing is quite easy to write unit
tests for. Some of the existing stuff in autotest.c is strange, in
the sense of not cleanly clearing out the game state before each test
and getting things set up consistently. But that issue of game state
isn't a problem for writing tests for lisp.c style code.
Although writing tests won't completely prevent unintended
consequences or bugs, it does make it easier to see what the code is
supposed to do and verify that it continues to work as it evolves.