rewritten read-lines with recursion

main
Inga 🏳‍🌈 1 year ago
parent e91d37e8bc
commit b50ad6a020
  1. 8
      day01-easy/main.scm

@ -4,11 +4,9 @@
(use-modules (ice-9 rdelim)) (use-modules (ice-9 rdelim))
(define (read-lines) (define (read-lines)
(let loop ((line (read-line))) ((lambda (line)
(if (if (eof-object? line) '() (cons line (read-lines))))
(eof-object? line) (read-line)))
'()
(cons line (loop (read-line))))))
(define (id value) value) (define (id value) value)

Loading…
Cancel
Save