[parenscript-devel] Conditional nesting of lisp and javascript code

Slobodan Milnović slobodan.milnovic at gmail.com
Fri May 13 17:52:02 UTC 2011


Hi!

I'm not sure what expressions/terms should I use for my situation, but
I'll try my best to explain it.

I have several functions combined under one ps:ps, and I'd like to
create different code depending on my, let's call it debug variable. I
have tried something like this:

(ps:ps

  (defun my-function (some-var)
     (ps:lisp
       (when (= my-debug-level debug-level-of-this-code)
           (ps:ps
               (ps:chain console (log "works!!!")))))
    (generate some fancy regular javascript code)))

Unfortunatelly, when the inner ps does its thing, it creates an
string, which then outer ps just attaches (and escapes appropriately)
as string, not as additional javascript code that is to be attached to
the rest. Is it possible to do this, or do I have to rethink my code?




More information about the parenscript-devel mailing list