(import magic-pipes) (import args) (import (chicken process-context)) (import medea) (receive (options operands before-exprs after-exprs usage) (parse-mp-args (command-line-arguments) '() "" "Read JSON expressions from standard input, and convert them to sexprs on standard output.") (unless (= (length operands) 0) (usage)) (let* ((ec (make-eval-context before-exprs '() after-exprs))) (let loop ((input (current-input-port))) (receive (sexpr next) (read-json input) (when sexpr (data-write sexpr) (newline) (loop next)))) (without-input-port (eval-context-end-closure ec))))