Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- (define (main)
- (define args (vector->list (current-command-line-arguments)))
- (define repl-path (car args))
- (define args-for-repl (cdr args))
- (define-values (repl out in err)
- (apply subprocess `(#f #f #f ,repl-path ,@args-for-repl)))
- (printf "subprocess status: ~a" (subprocess-status repl))
- (newline)
- (display "123" in)
- (newline in)
- (flush-output in)
- (printf "subprocess status: ~a" (subprocess-status repl))
- (newline)
- (define result (read-line out))
- (printf "subprocess status: ~a" (subprocess-status repl))
- (newline)
- (if (equal? result "123")
- (printf "Success! (~a)" result)
- (printf "Failure! (~a)" result))
- (newline)
- (close-input-port out)
- (close-input-port err)
- (close-output-port in)
- (subprocess-wait repl))
- (main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement