aboutsummaryrefslogtreecommitdiff
path: root/2024/aoc-utils.scm
blob: 6b57aa59a8b342f72be937767d5a308279b662eb (plain)
1
2
3
4
5
6
7
8
9
10
11
(define-module (aoc-utils)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-9)
  #:use-module (ice-9 regex)
  #:use-module (ice-9 rdelim)
  #:export (file->list))

(define (file->list filename)
  (let ((lines (string-split (call-with-input-file filename read-string) #\Newline)))
    ; Remove EOF token
    (take lines (1- (length lines)))))