Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 010670e365eac4bfdf0087ea1c497c2e > files > 95

gauche-0.9.3.2-1.fc15.i686.rpm

;; sample program to show how to use text.progress

(use text.progress)

(define (main args)
  (define (num-format cur max)
    (format "~d/~d(~3d%)" cur max
            (round->exact (/. (* cur 100) max))))
  
  (let ((p (make-text-progress-bar :header "Example"
                                   :header-width 10
                                   :bar-char #\o
                                   :num-format num-format
                                   :num-width 13
                                   :max-value 256)))
    (do ((i 0 (+ i 1)))
        ((= i 256) (p 'finish))
      (p 'inc 1)
      (sys-select #f #f #f 50000))))