2021-06-04 13:56:03 +00:00
|
|
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
;;; SPDX-FileCopyrightText: Copyright © 2010-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
2021-06-01 15:19:24 +00:00
|
|
|
|
2020-04-27 18:27:48 +00:00
|
|
|
#lang syndicate
|
2018-04-29 17:43:39 +00:00
|
|
|
|
2020-04-27 18:27:48 +00:00
|
|
|
(require/activate syndicate/drivers/external-event)
|
2018-04-29 17:43:39 +00:00
|
|
|
(require (only-in racket/port read-bytes-line-evt))
|
|
|
|
|
|
|
|
(spawn (define stdin-evt (read-bytes-line-evt (current-input-port) 'any))
|
|
|
|
(on (message (inbound (external-event stdin-evt (list $line))))
|
|
|
|
(if (eof-object? line)
|
|
|
|
(stop-current-facet)
|
|
|
|
(printf "~a\n" line))))
|