[plt-scheme] The historical role/value of set-car! and set-cdr!
----- Original Message -----
From: "Chongkai Zhu" <czhu at cs.utah.edu>
To: "Grant Rettke" <grettke at acm.org>
Cc: "pltscheme" <plt-scheme at list.cs.brown.edu>
Sent: Sunday, January 27, 2008 1:38 AM
Subject: Re: [plt-scheme] The historical role/value of set-car! and set-cdr!
> Say that you want a unfold-left that is tail recursive. The only way it to
> use set-cdr!
>
> Chongkai
>
(define (fold-right proc init . lists) (apply fold-left proc init (map
reverse lists)))
I guess this is hardly slower than using set-cdr!.
Jos Koot