Skip to content

Instantly share code, notes, and snippets.

@tompurl
Last active September 28, 2023 10:51
Show Gist options
  • Save tompurl/5174818 to your computer and use it in GitHub Desktop.
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.
(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)))
@massimo-zaniboni
Copy link

This should be the standard way:

(coerce some-list-of-chars 'string)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment