[plt-scheme] How to do something to all element of a list but the last

From: Eric Hanchrow (offby1 at blarg.net)
Date: Sat Aug 9 12:55:47 EDT 2008

How about something like this?
(require (lib "1.ss" "srfi"))

(pair-fold (lambda (a b)
             (when (not (null? (cdr a)))
               (printf "I'm doing something to ~s~%" (car a))))
           (list 1 2 3 4))
"That sounds like a bunch of baloney," [Feynman] said. "Give
me something real to do." So we sent him out to buy some office
        -- Danny Hillis

Posted on the users mailing list.