(define (tui-loop) (define table (make-piece-table "hola")) (let loop ((char (read-char))) (move-cursor! 0 0) (cond ((char=? #\q char) #f) (else (piece-table-insert! table 4 "hola" 'normal) (erase-screen!) (write-string (piece-table->string table)) (loop (read-char)))))) (define (call-with-tui thunk) (dynamic-wind tui-initialize! (lambda () (with-raw-io (current-input-port) thunk)) tui-deinitialize!)) (define (run arguments) (call-with-tui tui-loop))