Skip to content

Instantly share code, notes, and snippets.

@juan-reynoso
Created December 9, 2022 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juan-reynoso/430876b22acaa0e3a85820490cb00a5c to your computer and use it in GitHub Desktop.
Save juan-reynoso/430876b22acaa0e3a85820490cb00a5c to your computer and use it in GitHub Desktop.
;; list to string
CL-USER> (map 'string (lambda (x) (char (write-to-string x) 0)) '(1 2 3))
"123"
;; string to list
CL-USER> (map 'list (lambda (x) (intern (string-upcase (string x)))) "lisp")
(L I S P)
;; list to vector
CL-USER> (map 'vector (lambda (x) x) '( 1 2 3))
#(1 2 3)
;; vector to list
CL-USER> (map 'list (lambda (x) x) #(1 2 3))
(1 2 3)
;; list to a-list
CL-USER> (map 'list (lambda (x) (cons (car x) (cadr x))) '((1 "one") (2 "two")))
((1 . "one") (2 . "two"))our code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment