[plt-scheme] scribblings on PLT Scheme 4.0

From: Joe Marshall (jmarshall at alum.mit.edu)
Date: Tue May 29 19:01:28 EDT 2007

On 5/28/07, Eli Barzilay <eli at barzilay.org> wrote:
> My common !-operation is `reverse!' -- I use it very frequently to
> reverse a list result.

I'll do that as well if I know that the consing was done locally.

>  I also use `append!', but that's less
> frequent.

I don't think I've ever wanted this one.  I have used nreconc on occasion.
(nreconc foo bar) => (append! (reverse! foo) bar) , but more
efficiently.  I feel dirty afterwards, though.

There are many advantages to not using side effects, though.  Easier
debugging was mentioned, but you can get better performance and
smaller data structures by hash-consing and memoization, which you can
freely use if the code doesn't side effect.


Posted on the users mailing list.