Mon Oct 16 10:00:31 CEST 2006 asf(a)boinkor.net
* Add #.#+ readtime conditional functions.
* This adds functions that can be used in #+#. readtime conditionals, for example:
#+#.(alexandria:read-if (find-package :asdf-install)) :yay
#+#.(alexandria:read-if-fbound :install :asdf-install :exportedp t) :yay
* included in the patch is a commented-out portion that allows the
user to activate a #? read syntax. I'm not sure if that fits into
the conservativism constraints.
i've got this ready to be pushed and i suggest this for inclusion
and/or discussion:
(defun concatenate-symbol (&rest args)
"A DWIM symbol concatenate: Args will be converted to string and be
concatenated
to form the resulting symbol with one exception: when a package is
encountered then
it is stored as the target package to use at intern. If there was no package
among the args then the symbol-package of the first symbol encountered will be
used. If there are neither packages nor symbols among the args then
the result will
be interned into the current package at the time of calling."
(let* ((package nil)
(symbol-name (string-upcase
(with-output-to-string (str)
(dolist (arg args)
(typecase arg
(string (write-string arg str))
(package (setf package arg))
(symbol (unless package
(setf package (symbol-package arg)))
(write-string (symbol-name arg) str))
(integer (write-string (princ-to-string arg) str))
(character (write-char arg) str)
(t (error "Cannot convert argument ~S to
symbol" arg))))))))
(if package
(intern symbol-name package)
(intern symbol-name))))
--
- attila
"- The truth is that I've been too considerate, and so became
unintentionally cruel...
- I understand.
- No, you don't understand! We don't speak the same language!"
(Ingmar Bergman - Smultronstället)
Finally got around to merging WHEN-LET and friends.
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."