From da38ea4a50146fac9f055861a169f51365eb8090 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Sun, 25 Feb 2024 19:17:55 +0100 Subject: [PATCH] make code fit into smaller screens --- docs/docs/scheme-intro/input-output.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/docs/scheme-intro/input-output.md b/docs/docs/scheme-intro/input-output.md index f66cb73d..ec213120 100644 --- a/docs/docs/scheme-intro/input-output.md +++ b/docs/docs/scheme-intro/input-output.md @@ -230,7 +230,9 @@ You can simplify this function by using `for-each` higher order procedure. ```scheme (define (write-lines lst . rest) - (for-each (lambda (line) (apply write-line line rest)) lst)) + (for-each (lambda (line) + (apply write-line line rest)) + lst)) ``` You can use this with `call-with-output-file`: @@ -245,7 +247,8 @@ You can use this with `call-with-output-file`: (write-lines beatles port)))) (read-lines "test-3.scm") -;; ==> ("John Lennon" "Paul McCartney" "Ringo Starr" "George Harrison") +;; ==> ("John Lennon" "Paul McCartney" +;; ==> "Ringo Starr" "George Harrison") ``` You can also write to standard output when you omit the port: