Would it make sense to use declaim/declare to give the Closure compiler hints?<div><br></div><div>(defun foo (x)</div><div>  (declare (param (*number *String) x))</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
  (if (instanceof x *Number)</div><div>    (+ x "")</div><div>    x))</div><div><br></div><div>=></div><div><br></div><div>"/*</div><div> * @ param {Number|String} x</div><div> */</div><div>function (x) {</div>
<div>    return x instanceof Number ? x + "" : x;</div><div>}"<br clear="all"><br></div><div>This seems like maybe it is too specific to be a part of ParenScript on the whole though...</div><div><br>_Nick_<br>
<br>
<br><br><div class="gmail_quote">On Sun, Aug 22, 2010 at 9:55 AM, Bastian Müller <span dir="ltr"><<a href="mailto:bastian@turbolent.com">bastian@turbolent.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On 08/22/2010 06:12 PM, Vladimir Sedach wrote:<br>
<br>
Hi Vladmimir,<br>
<div class="im"><br>
> Are you making a library? If so, are you looking to document<br>
> particular functions, or insert inline comments in arbitrary places?<br>
> If it's the functions, then it might make sense for me to add<br>
> optional output of function and variable docstrings to JS comments;<br>
> that would spare the need for a new special form and syntax for<br>
> comments.<br>
><br>
> As for arbitrary JS code, if there is a case where there is some JS<br>
> code that you need that cannot be generated by Parenscript, it<br>
> should be considered a bug in Parenscript.<br>
<br>
</div>Indeed, I'd like to create docstrings for functions and variables, so<br>
that Google's Closure compiler can be used to optimize and check the<br>
generated JavaScript Code. The annotations are documented here:<br>
<br>
<a href="http://code.google.com/closure/compiler/docs/js-for-compiler.html" target="_blank">http://code.google.com/closure/compiler/docs/js-for-compiler.html</a><br>
<br>
The comment special-form was the only thing I was able to add to<br>
parenscript. Docstrings would help a lot. On top of them, a separate<br>
library could provide convenience macros to generate the annotation<br>
comments compatible with Closure.<br>
<br>
Cheers,<br>
<font color="#888888">  Bastian<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
parenscript-devel mailing list<br>
<a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>
</div></div></blockquote></div><br></div>