(use-modules (ice-9 rdelim)) (define (go args) (display "WORKING ") (write args) (newline)) (define (stop args) (display "STOPPED ") (write args) (newline)) (define (repl) ;; Loop (while #t ;; Prompt (display "> ") ;; Read (let* ((input (read-line)) ;; Tokenize (tokens (string-tokenize input))) ;; Eval (if (null? tokens) (continue) (let ((cmd (car tokens)) (args (cdr tokens))) (cond ((string=? cmd "GO") (go args)) ((string=? cmd "STOP") (stop args)) ((string=? cmd "QUIT") (break)) (else (display "Unknown command") (newline)))))))) (repl)