(defpackage #:advent.2024.00 (:use #:cl) (:export #:vector->list #:list->vector #:input #:with-input)) (in-package #:advent.2024.00) ;;; Utility functions and stuff (defun vector->list (v) "Convert V, a one-dimensional vector or string, to a list." (loop for el across v collect el)) (defun list->vector (l) "Convert L to a vector." (apply #'vector l)) (defun input (&optional (package-designator *package*)) (format nil "~A.input" (subseq (package-name package-designator) 12))) (defmacro with-input (&body body) `(let ((,(find-symbol "*INPUT*" *package*) (input))) ,@body))