Commit 0d7f0ea9 authored by Attila Lendvai's avatar Attila Lendvai
Browse files

added symbolicate

parent d03b7bf2
......@@ -134,4 +134,6 @@
#:write-string-into-file
#:copy-stream
#:copy-file
;; new additions collected at the end
#:symbolicate
))
......@@ -38,3 +38,16 @@ PACKAGE."
GENSYM using (if provided) as the argument."
(loop repeat length
collect (gensym x)))
(defun symbolicate (&rest things)
"Concatenate together the names of some strings and symbols,
producing a symbol in the current package."
(let* ((length (reduce #'+ things
:key (lambda (x) (length (string x)))))
(name (make-array length :element-type 'character)))
(let ((index 0))
(dolist (thing things (values (intern name)))
(let* ((x (string thing))
(len (length x)))
(replace name x :start1 index)
(incf index len))))))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment