web/dom, util:to-string: minor improvements - now should also work for numbers and other types
This commit is contained in:
parent
ead8f6eb80
commit
ae7545d5ce
2 changed files with 6 additions and 6 deletions
|
@ -13,10 +13,10 @@
|
|||
(defun flatten-str (s &key (with " "))
|
||||
(str:join with (str:lines s)))
|
||||
|
||||
(defun to-string (k)
|
||||
(defun to-string (k &key (sep " "))
|
||||
(if (atom k)
|
||||
(string-downcase k)
|
||||
(str:join " " (mapcar #'string-downcase k))))
|
||||
(format nil "~(~a~)" k)
|
||||
(str:join sep (mapcar #'(lambda (s) (format nil "~(~a~)" s)) k))))
|
||||
|
||||
(defun to-keyword (s)
|
||||
(intern (string-upcase s) :keyword))
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
,@body
|
||||
(get-output-stream-string *output*)))
|
||||
|
||||
(defmacro text (s)
|
||||
`(put-string (string ,s)))
|
||||
|
||||
(defmacro put-string (s)
|
||||
`(write-string ,s *output*))
|
||||
|
||||
|
@ -59,6 +56,9 @@
|
|||
(put-string tag)
|
||||
(put-char #\>))
|
||||
|
||||
(defun text (s)
|
||||
(put-string (string s)))
|
||||
|
||||
(defun newline ()
|
||||
(put-char #\Newline))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue