From a0bcb57cbcfbfa8070ee617056983b03e8e64c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Fri, 4 Nov 2022 00:40:17 -0300 Subject: Add str:from-list --- str.lisp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'str.lisp') diff --git a/str.lisp b/str.lisp index e099e26..cbd6fe3 100644 --- a/str.lisp +++ b/str.lisp @@ -19,3 +19,13 @@ (length input))) (queue:add result (subseq input start next))))) (queue:to-list (split-rec (queue:new) 0))) + +(declaim (ftype (function ((cons char)) (values simple-string) &optional)) from-list) +(defun from-list (lst) + (let ((str (make-string (length lst))) + (i 0)) + (dolist (item lst) + (setf (char str i) item) + (incf i)) + str)) + -- cgit v1.2.3