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))
(define (read-lines)
(let loop ((line (read-line)))
(if
(eof-object? line)
'()
(cons line (loop (read-line))))))
((lambda (line)
(if (eof-object? line) '() (cons line (read-lines))))
(read-line)))
(define (id value) value)

Loading…
Cancel
Save