[plt-scheme] The historical role/value of set-car! and set-cdr!

From: Jos Koot (jos.koot at telefonica.net)
Date: Sat Jan 26 19:51:21 EST 2008

----- 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 



Posted on the users mailing list.