From 5b3f2bd42198f700b498d53fae50cf1835fad210 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Wed, 14 Oct 2026 20:07:03 +0300 Subject: [PATCH] name the test for output going to stdout -o - was taught to two copies of it. --- sexc.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sexc.scm b/sexc.scm index 793f2236..2d75475d 100644 --- a/sexc.scm +++ b/sexc.scm @@ -142,8 +142,11 @@ 'stdin (car rest-args)))) +(define (stdout-output? output) + (or (eq? output 'default) (equal? output "-"))) + (define (write-to-file-or-stdout output what) - (if (or (eq? output 'default) (equal? output "-")) + (if (stdout-output? output) (what) (with-output-to-file output (fn (what))))) @@ -169,7 +172,7 @@ modules))))) (define (write-dependencies depfile output input) - (when (or (eq? output 'default) (equal? output "-")) + (when (stdout-output? output) (error "--depfile needs -o, to name what depends on the modules")) (with-output-to-file depfile (lambda ()