diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2022-11-04 00:40:17 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2022-11-04 00:40:17 -0300 |
commit | a0bcb57cbcfbfa8070ee617056983b03e8e64c29 (patch) | |
tree | 478181d36dd875c542c10c5dd2fac2dba940957d /str.lisp | |
parent | ca2362bc53b548c1e0b2a725545984854fe62413 (diff) | |
download | utils-a0bcb57cbcfbfa8070ee617056983b03e8e64c29.tar.gz utils-a0bcb57cbcfbfa8070ee617056983b03e8e64c29.zip |
Add str:from-list
Diffstat (limited to 'str.lisp')
-rw-r--r-- | str.lisp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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)) + |