If you want to make sure that identifiers generated by Parenscript don't clash with those in third-party Javascript, wouldn't you have to parse the third-party Javascript? <br><br>Daniel<br><br><div><span class="gmail_quote">
On 6/20/07, <b class="gmail_sendername">John Fremlin</b> <<a href="mailto:john@fremlin.org">john@fremlin.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
"Vladimir Sedach" <<a href="mailto:vsedach@gmail.com">vsedach@gmail.com</a>> writes:<br>--text follows this line--<br>> That sounds like a good idea, but I think it would be difficult to<br>> implement correctly. The problem is that name mangling would have to
<br>> take place both when you declare the variables/functions, and when you<br>> access them. So there would have to be some global state to keep track<br>> of which identifiers have already been declared in ParenScript code so
<br>> that the corresponding name-mangling could take place when those<br>> identifiers are accessed.<br><br>Yes, I am well aware. If it didn't involve so much hard work, I would<br>have done it already.<br><br>
However, this is another motivation for parenscript moving more<br>towards being a proper Lisp to JavaScript compiler. Eventually, being<br>able to run the same code in Lisp on the server as in JavaScript on<br>the client would obviously be awesome.
<br><br>The definition tracking functionality would also be useful for<br>code-compression (choosing short identifiers) as someone else<br>suggested.<br><br>Of course, I suppose constant folding (as you suggested) is the first
<br>step and would definitely be much more practical.<br><br><br>[...]<br><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">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br></blockquote></div><br>