I'm really liking parenscript and just got started with it, so this question might be off base, but here goes...
I'm writing a parenscript/cl-who/hunchentoot application, and I'm using some code along the lines of:
(css-to-string '(((a.foo) (:color "green" :font-size "25pt")) ((a.foo:hover) (:color "red"))))
which generates the following string:
"A.FOO { color:green; font-size:25pt; }
; A.FOO:HOVER { color:red; }
"
Firefox doesn't seem to like the second rule, since it starts with a semicolon. The code of css-to-string I have is:
(defun css-to-string (rules) (string-join (mapcar #'css-rule-to-string rules) "; "))
If I substitute it with
(defun css-to-string (rules) (concatenate 'string (mapcar #'css-rule-to-string rules)))
That problem goes away and Firefox recognizes the second rule.
Am I doing something wrong or is this a bug?
Oops. I want to make a correction.
(concatenate 'string ...)
wasn't right. I can make my code work with
(defun css-to-string (rules) ;; (string-join (mapcar #'css-rule-to-string rules) "; ") (string-join (mapcar #'css-rule-to-string rules) " "))
...notice the missing semicolon from the string-join string.
Thanks.
On Wed, May 21, 2008 at 4:45 PM, Stuart Overton stuartoverton@gmail.com wrote:
I'm really liking parenscript and just got started with it, so this question might be off base, but here goes...
I'm writing a parenscript/cl-who/hunchentoot application, and I'm using some code along the lines of:
(css-to-string '(((a.foo) (:color "green" :font-size "25pt")) ((a.foo:hover) (:color "red"))))
which generates the following string:
"A.FOO { color:green; font-size:25pt; }
; A.FOO:HOVER { color:red; }
"
Firefox doesn't seem to like the second rule, since it starts with a semicolon. The code of css-to-string I have is:
(defun css-to-string (rules) (string-join (mapcar #'css-rule-to-string rules) "; "))
If I substitute it with
(defun css-to-string (rules) (concatenate 'string (mapcar #'css-rule-to-string rules)))
That problem goes away and Firefox recognizes the second rule.
Am I doing something wrong or is this a bug?
parenscript-devel@common-lisp.net