[plt-scheme] SetW routine

From: G. Saini (gsaini at u.washington.edu)
Date: Sat Jan 3 18:21:29 EST 2004

1) Is there an equivelent function to setw (set-column-width) by some
other name in mzscheme so I don't have to reinvent the wheel?
2) If there isn't is it possible to satisfy the following function
definition?

(define blank " ")

(define (setw n)
  (define (print-blanks x)
     (if (empty? x)
         (printf "~A" blank)
         (print-blanks (1- x))))
  (print-blanks (- n
                   (f (current-output-port)))))


Where f is some function that returns the number of columns
printed out by a last call to printf? The number must be
reset to zero (i think) everytime there is a newline.


thanks!
--Gurp



Posted on the users mailing list.