[plt-scheme] Re: Destructive Sort. Really dumb question.
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!