[plt-scheme] append!?

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Oct 20 21:06:26 EDT 2007

On Oct 20, Robby Findler wrote:
> These are comments about the specification of Scheme itself, I suppose?
> 
> Matthias was, I believe, speaking of PLT Scheme, which is definitely
> always going to mutate (non-empty) lists that appear as the first
> argument to append!.

This is the case with many Schemes, and with CL's `nconc'.

To use it sanely for changing a list, you should make sure that you
always pass in a non-empty list, and to use it as a kind of an
optimization you should always use the

  (set! l (append! l ...))

thing.  But these kind of games can get very dangerous, you should be
very careful if you want to use that.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.