[parenscript-devel] :join isn't being interpreted as a javascript function

Daniel Gackle danielgackle at gmail.com
Tue May 29 14:59:31 UTC 2012


Russell,

Let's wait for Vladimir to double-check this, but I expect he'll apply your
patch when he's back.

Daniel


On Mon, May 28, 2012 at 7:15 PM, Russell Sim <russell.sim at gmail.com> wrote:

> Hi,
>
> I think I have encountered a bug while using the who-ps-html macro.
>
> (who-ps-html
>  (:li
>    (:img :src icon :size 40)
>    (:p message)
>    (:span :class "author" name)
>    (:span :class "date" timestamp)))
>
> The first expansion of the who-ps-html yields,
>
> (STRINGIFY "<LI><IMG SRC=\"" ICON "\" SIZE=\"40\"><P>" MESSAGE
>           "</P><SPAN CLASS=\"author\">" NAME "</SPAN><SPAN CLASS=\"date\">"
>           TIMESTAMP "</SPAN></LI>")
>
> But the javascript generated is,
>
> ['<LI><IMG SRC="', icon, '" SIZE="40"><P>', message, '</P><SPAN
> CLASS="author">', name, '</SPAN><SPAN CLASS="date">', timestamp,
> '</SPAN></LI>']['join']('')
>
> I have been able to get the correct behaviour by applying the following
> patch, since join is a symbol that is imported via the ps-js-symbols
> package.
>
> commit 86d39309692987644798148e24fd67b70667eaa7 (HEAD, refs/heads/master)
> Author: Russell Sim <russell.sim at gmail.com>
> Date:   Tue May 29 09:12:30 2012 +1000
>
>    Fixed :join bug in stringify expansion.
>
>        Modified   src/non-cl.lisp
> diff --git a/src/non-cl.lisp b/src/non-cl.lisp
> index 387bd29..f2ed0e7 100644
> --- a/src/non-cl.lisp
> +++ b/src/non-cl.lisp
> @@ -203,7 +203,7 @@
>  (defpsmacro stringify (&rest things)
>   (if (and (= (length things) 1) (stringp (car things)))
>       (car things)
> -      `((@ (list , at things) :join) "")))
> +      `((@ (list , at things) join) "")))
>  (defun stringify (&rest things)
>   "Like concatenate but prints all of its arguments."
>   (format nil
> "�窿�翳轭珞┅����描邋蝮��阴篌屐����哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌哌��疳蝈铙泸轲舡溴鲥�磲殪轭�扉篝��疳蝈铙泸轲舡溴鲥炖泔眄镱轶甬铄��梏麴函轶趔镯盹瞽扉箴弭玳轭衢祉犷轶糸铈锆疳蝈铙泸轲舡溴鲥��
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20120529/5b85550f/attachment.html>


More information about the parenscript-devel mailing list