Last active
September 28, 2023 10:51
-
-
Save tompurl/5174818 to your computer and use it in GitHub Desktop.
Common Lisp function that converts a list into a string of concatenated characters.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun numlist-to-string (lst) | |
(when lst | |
(concatenate 'string | |
(write-to-string (car lst)) (numlist-to-string (cdr lst))))) | |
; Convert a list of numbers into a number | |
; (list 1 2 3 4) => 1234 | |
(parse-integer (numlist-to-string (list 1 2 3 4))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should be the standard way: