プログラミングGauche をよむ

p139

(define (last-pair lis)
  (if (pair? lis)
      (if (or (null? (cdr lis))
              (not (pair? (cdr lis))))
          lis
          (last-pair (cdr lis)))
      (error "last-pair needs a pair, but got:" lis)))

p202

(define (write-to-string x)
  (call-with-output-string (lambda (out) (write x out))))

(define (read-from-string str)
  (call-with-input-string str (lambda (in) (read in))))