[plt-scheme] Re: Destructive Sort. Really dumb question.

From: bullockbefriending bard (kinch1967 at gmail.com)
Date: Thu May 22 13:56:04 EDT 2008


On May 23, 12:18 am, "Robby Findler" <ro... at cs.uchicago.edu> wrote:
> sort! just changes the structure of the internal cons cell nodes in
> your list. It doesn't change what `y' is bound to. After the cons
> cells have been rearranged, the variable "y" still refers to that same
> cons cell it referred to before, but now that cons cell is somewhere
> in the middle of the list, its no longer at the front.
>
> That's why sort! returns something -- so you know which one is now the
> front most one.
>
> Robby

*smacks head*

Enlightenment achieved. Thanks!



Posted on the users mailing list.