Hi Parenscripters,<br><br>As far as I can tell, multiple-value function calls are a unique feature of lisp. I would like the ability to perform multiple-value calls in Parenscript but I don't know if a sane solution exists or not.<br>
<br>Can anyone come up with a scheme for returning multiple values that translates well to Javascript? Ideally such a scheme would not introduce much overhead for usual functions that do not use or return multiple values (though perhaps setting some sort of global MV flag might be inexpensive enough). Functions that return multiple values should also only appear to return a single value when called by a function that expects only one return value (including native javascript functions).<br>
<br>(defun paren-mv-returner ()<br> (return (values 1 2 3)))<br><br>=><br><br><br>
function parenMvReturner() {<br>
/* do some magic with the values 2 and 3 */<br>
return 1; <br>
}<br><br>// one implementation might be<br>var mv = undefined;<br><br>function parenMvReturner() {<br>
mv = [2, 3];<br> return 1; <br>
}<br><br>// this scheme needs to adjust the return statement of every function so it might not be sufficient<br>// consider this other function<br><br>function parenMySingleReturner () {<br> var x = parenMvReturner();<br>
<br><br>