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 " "))
|
(defun flatten-str (s &key (with " "))
|
||||||
(str:join with (str:lines s)))
|
(str:join with (str:lines s)))
|
||||||
|
|
||||||
(defun to-string (k)
|
(defun to-string (k &key (sep " "))
|
||||||
(if (atom k)
|
(if (atom k)
|
||||||
(string-downcase k)
|
(format nil "~(~a~)" k)
|
||||||
(str:join " " (mapcar #'string-downcase k))))
|
(str:join sep (mapcar #'(lambda (s) (format nil "~(~a~)" s)) k))))
|
||||||
|
|
||||||
(defun to-keyword (s)
|
(defun to-keyword (s)
|
||||||
(intern (string-upcase s) :keyword))
|
(intern (string-upcase s) :keyword))
|
||||||
|
|
|
@ -18,9 +18,6 @@
|
||||||
,@body
|
,@body
|
||||||
(get-output-stream-string *output*)))
|
(get-output-stream-string *output*)))
|
||||||
|
|
||||||
(defmacro text (s)
|
|
||||||
`(put-string (string ,s)))
|
|
||||||
|
|
||||||
(defmacro put-string (s)
|
(defmacro put-string (s)
|
||||||
`(write-string ,s *output*))
|
`(write-string ,s *output*))
|
||||||
|
|
||||||
|
@ -59,6 +56,9 @@
|
||||||
(put-string tag)
|
(put-string tag)
|
||||||
(put-char #\>))
|
(put-char #\>))
|
||||||
|
|
||||||
|
(defun text (s)
|
||||||
|
(put-string (string s)))
|
||||||
|
|
||||||
(defun newline ()
|
(defun newline ()
|
||||||
(put-char #\Newline))
|
(put-char #\Newline))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue