I have:
(ps:ps (ps:var vertices (ps:lisp (cons 'list *VERTICES*))))
which evaluates to:
"var vertices = [0.0, -200.0, 0, ... 0.4, 40];"
which is the correct expected result.
Where:
ps
refers to parenscript (full documentation is here).*VERTICES*
is just a plain flat list of numbers in my global Lisp environment
However, When *VERTICES*
is large, the evaluation leads to the error:
Error: Too many arguments. While executing: PARENSCRIPT::COMPILE-SPECIAL-FORM, in process listener(1).
How do I get around this error?
Not knowing how parenscript really works internally, this problem is hard to solve. So I tried changing the way the list is passed to ps.
Here are a few failed attempts:
(ps:ps (ps:var vertices (ps:lisp (list *VERTICES*))))
=> "var vertices = 1(2, 3, 4, 0, 9, 0.1)();"
(ps:ps (ps:var vertices (ps:lisp *VERTICES*)))
=> "var vertices = 1(2, 3, 4, 0, 9, 0.1);"
(ps:ps (ps:var vertices *VERTICES*))
=> "var vertices = VERTICES;"
None are the correct expected output.
What is the right way to pass a Lisp list variable's value to parenscript to form a correct javascript array-variable assignment-statement?