<div>I'm glad to see the tighter code being generated for keyword</div><div>arguments, but I'm afraid there's a problem. If a default value is</div><div>provided, it is now being evaluated whether it's needed or not:</div>
<div><br></div><div>(defun blah (&key (param (long-running-computation)))</div><div> (foo param))</div><div><br></div><div>=></div><div><br></div><div>function blah() {</div><div> var param = longRunningComputation();</div>
<div> var _js10 = arguments.length;</div><div> // ...</div><div> return foo(param);</div><div>};</div><div><br></div><div>Compare this to:</div><div><br></div><div>(defun blah (&optional (param (long-running-computation)))</div>
<div> (foo param))</div><div><br></div><div>=></div><div><br></div><div>function blah(param) {</div><div> if (param === undefined) {</div><div> param = longRunningComputation();</div><div> };</div><div> return foo(param);</div>
<div>};</div><div><br></div><div>I think the above keyword behavior is incorrect and the optionals have</div><div>it right. Yet I like the fact that all the sludge of the "if</div><div>variable remains undefined after sucking out the optional arguments</div>
<div>then set it to null" sort has been removed.</div><div><br></div><div>Is there a compromise? For example, could we do it the simpler way</div><div>where the default value is a constant?</div><div><br></div><div>
Daniel</div>