From ae564f2d20a40863246286119882e8fb25a5fd3b Mon Sep 17 00:00:00 2001 From: "O'Keefe, Colin B" Date: Mon, 2 Oct 2023 10:13:34 -0700 Subject: [PATCH] Add Into (Optional :a) (List :a) instance. --- library/list.lisp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/list.lisp b/library/list.lisp index 9f0126361..bb8cf99b5 100644 --- a/library/list.lisp +++ b/library/list.lisp @@ -757,6 +757,12 @@ This function is equivalent to all size-N elements of `(COMBS L)`." (cl:setf current top))) :finally (cl:return top))))) + (define-instance (Into (Optional :a) (List :a)) + (define (into opt) + (match opt + ((None) Nil) + ((Some a) (Cons a Nil))))) + (define-instance (Default (List :a)) (define (default) Nil)))