ERROR: invalid-percent x ;
: check-percent ( x -- x )
- dup 0 1 between? [ throw-invalid-percent ] unless ;
+ dup 0 1 between? [ invalid-percent ] unless ;
ERROR: invalid-length x ;
: check-length ( x -- x )
- dup { [ 0 > ] [ integer? ] } 1&& [ throw-invalid-length ] unless ;
+ dup { [ 0 > ] [ integer? ] } 1&& [ invalid-length ] unless ;
: (make-progress-bar) ( percent len completed-ch pending-ch -- string )
[ [ * >integer ] keep over - ] 2dip