[parenscript-devel] Re: BUG in css-to-string?

Stuart Overton stuartoverton at gmail.com
Thu May 22 17:36:30 UTC 2008


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 at 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?
>



More information about the parenscript-devel mailing list