Hi,
is there a mode to transform a word into a list, e.g. (word) -> (w o r d)?
Thanx
filfil
(defun struct->list (l)
(coerce (string (car l)) 'list))
(coerce "string" 'list)> (struct->list '(word))
(#\W #\O #\R #\D)> (setf a (struct->list '(word)))
(#\W #\O #\R #\D)
> (mapcar #'string a)
("W" "O" "R" "D")
(W O R D)(defun explode (object)
(loop for char across (prin1-to-string object)
collect (intern (string char))))
(defun implode (list)
(read-from-string (coerce (mapcar #'character list) 'string)))(explode 'hello) => (H E L L O)
(implode '(h e l l o)) => HELLOUsers browsing this forum: Bing [Bot] and 0 guests