This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug in append!


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]