I've finally got back to working through the output of the new PS, and have hit another couple of errors. The following form:<div><br></div><div><div>(lambda (x)</div><div> (apply (lambda (y) (bar (1+ y))) x))</div></div>
<div><br></div><div>...compiles to...</div><div><br></div><div><div>function (x) {</div><div> return function (y) {</div><div> return bar(y + 1);</div><div> }.apply(this, x);</div><div>};</div></div><div><br>
</div><div>... which is a syntax error. Earlier PS put parentheses around the inner function, which is correct:</div><div><br></div><div><div>function (x) {</div><div> return (function (y) {</div><div> return bar(y + 1);</div>
<div> }).apply(this, x);</div><div>};</div></div>