[plt-scheme] too easy question: local/global parameter set!

From: Thomas Chust (chust at web.de)
Date: Tue Aug 11 14:38:22 EDT 2009

2009/8/11 junior schemer <juniorscheme at hotmail.com>:
> [...]
> (define new-item (vector item-index 'new-item))
> [...]
> (add-item new-item)
> (add-item new-item)
> [...]


you call add-item with the *same* item multiple times, therefore you
end up with a list that contains several references to the same item
that has been mutated several times.


When C++ is your hammer, every problem looks like your thumb.

Posted on the users mailing list.