From 59b2be1021c6308929890c59f2ed5d187337a003 Mon Sep 17 00:00:00 2001 From: Jack Kinsey Date: Wed, 23 Dec 2020 02:17:28 -0500 Subject: [PATCH] Add cl-interpol --- adventofcode2020.asd | 1 + package.lisp | 6 +++--- src/day03.lisp | 2 +- src/day04.lisp | 2 +- src/day06.lisp | 2 +- src/day07.lisp | 2 +- src/day08.lisp | 2 +- src/day09.lisp | 2 +- src/day10.lisp | 2 +- src/day11.lisp | 2 +- src/day12.lisp | 2 +- src/dayNN.lisp | 2 +- 12 files changed, 14 insertions(+), 13 deletions(-) diff --git a/adventofcode2020.asd b/adventofcode2020.asd index 69c5919..1a39ad7 100644 --- a/adventofcode2020.asd +++ b/adventofcode2020.asd @@ -9,6 +9,7 @@ :arrow-macros :cl-ppcre :cl-utilities + :cl-interpol :fn :fiveam) :pathname "src/" diff --git a/package.lisp b/package.lisp index a21511c..54e35cf 100644 --- a/package.lisp +++ b/package.lisp @@ -1,6 +1,3 @@ -; (progn (ql:quickload :fiveam) -; (ql:quickload :cl-ppcre) -; (ql:quickload :fn)) (defpackage :adventofcode2020 (:use :cl :arrow-macros @@ -13,3 +10,6 @@ :split-sequence-if :split-sequence-if-not) (:nicknames :aoc2020)) +(in-package :adventofcode2020) +(named-readtables:defreadtable :adventofcode2020 + (:merge :standard fn-reader :interpol-syntax)) diff --git a/src/day03.lisp b/src/day03.lisp index 093654f..6098daa 100644 --- a/src/day03.lisp +++ b/src/day03.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun tree-collisions (slope tree-map) (loop with (rise run) = slope diff --git a/src/day04.lisp b/src/day04.lisp index cb8916f..42e12d6 100644 --- a/src/day04.lisp +++ b/src/day04.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun parse-passport (str-list) (flet ((parser (str) diff --git a/src/day06.lisp b/src/day06.lisp index e116865..2f58f72 100644 --- a/src/day06.lisp +++ b/src/day06.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun count-answers (join ans-list) (->> ans-list diff --git a/src/day07.lisp b/src/day07.lisp index db50ca8..13c4d33 100644 --- a/src/day07.lisp +++ b/src/day07.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun parse-bag-rule (rule) (cl-ppcre:all-matches-as-strings diff --git a/src/day08.lisp b/src/day08.lisp index 8d8f7c8..458a562 100644 --- a/src/day08.lisp +++ b/src/day08.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun make-program (insts) (let ((len (length insts)) diff --git a/src/day09.lisp b/src/day09.lisp index 7d5aab8..c1a8a59 100644 --- a/src/day09.lisp +++ b/src/day09.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun make-preambled-list (list k i) (subseq list (- i k) (1+ i))) diff --git a/src/day10.lisp b/src/day10.lisp index 5359b46..7f37259 100644 --- a/src/day10.lisp +++ b/src/day10.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun joltage-distribution (ratings) (let* ((extended (append '(0) ratings (mapcar λ(+ 3 _) (last ratings))))) diff --git a/src/day11.lisp b/src/day11.lisp index f5641dc..ac4b831 100644 --- a/src/day11.lisp +++ b/src/day11.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun parse-layout (layout) (make-array (list (length layout) (length (car layout))) diff --git a/src/day12.lisp b/src/day12.lisp index 0dbfdfc..3e3b556 100644 --- a/src/day12.lisp +++ b/src/day12.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (defun parse-action (str) (cl-ppcre:register-groups-bind diff --git a/src/dayNN.lisp b/src/dayNN.lisp index bd53ef0..9e83750 100644 --- a/src/dayNN.lisp +++ b/src/dayNN.lisp @@ -1,6 +1,6 @@ (asdf:load-system :adventofcode2020) (in-package #:adventofcode2020) -(named-readtables:in-readtable fn-reader) +(named-readtables:in-readtable :adventofcode2020) (day 00 input (let ((lines (list-from input))) -- 2.38.5