Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 5a3d998cc00060c67a9a8d7f23c2d34c > files > 90

gauche-0.8.14-3.fc11.x86_64.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))))