This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: bug in append!
- To: orre at nada dot kth dot se (Roland Orre)
- Subject: Re: bug in append!
- From: Marius Vollmer <mvo at zagadka dot ping dot de>
- Date: 18 Oct 1999 20:11:21 +0200
- Cc: Ivan Toshkov <ivant at intransco dot com>, guile at sourceware dot cygnus dot com
- References: <199910181216.OAA28725@faun.nada.kth.se>
Roland Orre <orre@nada.kth.se> writes:
> When you develop things it is always a good rule to use e.g
> (set! a (append a '(b)))
> and when everything works you can change some of the append to append!
> to possibly speed up things.
I don't think that this is a good advice. `append!' and `append'
behave very differently when it comes to sharing of cons cells and
this becomes very important when you modify your lists later (with
`set-car!' or `set-cdr!', for example). Thus, replacing `append' with
`append!' is not merely a performance hack, it affects the behaviour
of your program in a fundamental way.