<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The error message is misleading. &nbsp;It's probably the<div>same global variable that is declared more than once.</div><div>It's detecting that&nbsp;it's trying to write a file by the same</div><div>name twice and complaining about that. &nbsp;Remember</div><div>that every global (top level variable) gets its own file.</div><div><br class="webkit-block-placeholder"></div><div>If we have need to allow something like this:</div><div><br class="webkit-block-placeholder"></div><div>&nbsp;&nbsp; &nbsp;var x;</div><div>&nbsp;&nbsp; &nbsp;...</div><div>&nbsp;&nbsp; &nbsp; var x;</div><div><br class="webkit-block-placeholder"></div><div>(like they allow in C), I'll need to make some changes.</div><div><br class="webkit-block-placeholder"></div><div>Let me know, In the meantime, I'll fix the error message.</div><div><br></div><div><br class="webkit-block-placeholder"></div><div><div><div><div>On Mar 27, 2008, at 5:42 PM, Henry Minsky wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">The compiler complains about compiling tests in test/lztest<br><br>(I removed the debug=true from the lztest-animator.lzx, and it says<br><br>Compiling: ../lztest/lztest-animator.lzx to ../lztest/lztest-animator.lzr=swf9.swf<br> Compilation errors occurred:<br>: org.openlaszlo.sc.CompilerError: cannot declare class name more than once: "LzTestManager"<br><br>lps/components/lztest/lztestmanager.lzx defines the LzTestManager, it's not a class, just an object<br> with methods on it (prototype-style OO). <br><br>I haven't looked yet what it is compiling to, is there a way to get the script compiler to give more info? <br><br><br><div class="gmail_quote">On Thu, Mar 27, 2008 at 5:30 PM, P T Withington &lt;<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>&gt; wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">We're getting real close! &nbsp;Can we run an lzunit test now?<br> <div><div></div><div class="Wj3C7c"><br> On 2008-03-27, at 16:43 EDT, Henry Minsky wrote:<br> &gt; Hey, I got the test to run, by manually fixing up the superclass<br> &gt; name, the<br> &gt; entry in ConstructorMap, and that boolean type declaration.<br> &gt;<br> &gt; Yay!<br> &gt;<br> &gt;<br> &gt; On Thu, Mar 27, 2008 at 4:28 PM, Henry Minsky &lt;<a href="mailto:henry.minsky@gmail.com">henry.minsky@gmail.com</a>&gt;<br> &gt; wrote:<br> &gt;<br> &gt;&gt; Tucker and I are working on the class name issue, we are putting<br> &gt;&gt; something<br> &gt;&gt; into the compiler to<br> &gt;&gt; put the correct LFC classnames (LzView, LzNode, etc) as the<br> &gt;&gt; superclass<br> &gt;&gt; name.<br> &gt;&gt;<br> &gt;&gt; And we're adding code to enter the user-class name into the<br> &gt;&gt; ConstructorMap<br> &gt;&gt; table, so that the instantiator<br> &gt;&gt; knows what real JS class name corresponds to the LZX tag name.<br> &gt;&gt;<br> &gt;&gt; Thanks!<br> &gt;&gt;<br> &gt;&gt; Maybe we should have a chat room going so we can all see what's<br> &gt;&gt; happening. &nbsp; Are you on iChat Don?<br> &gt;&gt;<br> &gt;&gt;<br> &gt;&gt;<br> &gt;&gt; On Thu, Mar 27, 2008 at 4:06 PM, Donald Anderson &lt;<a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a>&gt;<br> &gt;&gt; wrote:<br> &gt;&gt;<br> &gt;&gt;&gt; I'm looking at the generated code now.There's a few things that<br> &gt;&gt;&gt; pop out<br> &gt;&gt;&gt; right away.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; 1) we generate this:<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &nbsp; dynamic class $lzc$class_foobar extends $lzc$class_view {<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; I'm guessing that this should be extends 'LzView' ?<br> &gt;&gt;&gt; That's what you need the LFC dictionary for?<br> &gt;&gt;&gt; So I changed the three occurrences of $lzc$class_view to LzView.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; 2) it looks like there are some static stuff in the user class like<br> &gt;&gt;&gt; this:<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; static var tagname = "foobar";static var children =<br> &gt;&gt;&gt; LzNode.mergeChildren([{attrs:<br> &gt;&gt;&gt; {bgcolor: 16711000, height: 100, width: 100}, name: "view"}, {attrs:<br> &gt;&gt;&gt; {bgcolor: 255, height: 150, width: 200, x: 175, y: 100}, name:<br> &gt;&gt;&gt; "view"}],<br> &gt;&gt;&gt; $lzc$class_view["children"]);static var attributes = new<br> &gt;&gt;&gt; LzInheritedHash($lzc$class_view.attributes);<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Is there some what that the name "foobar" gets registered to the<br> &gt;&gt;&gt; application to know about this class?<br> &gt;&gt;&gt; Is it some side effect of this static code? (if so, we need a way<br> &gt;&gt;&gt; to get<br> &gt;&gt;&gt; the class initialized).<br> &gt;&gt;&gt; But I don't see the string "foobar" anywhere, except in the tagname.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; After all, the main code has this:<br> &gt;&gt;&gt; &nbsp;LzInstantiateView({attrs: {x: 100}, name: "foobar"}, 3);<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; So it's got to find the name "foobar" someplace?<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; 3) there are compilation errors in $lzc$class_foobar.as, and we<br> &gt;&gt;&gt; don't<br> &gt;&gt;&gt; see them because<br> &gt;&gt;&gt; $lzc$class_foobar is never referenced anywhere. &nbsp;My temporary<br> &gt;&gt;&gt; workaround<br> &gt;&gt;&gt; was to insert<br> &gt;&gt;&gt; a dummy function in $lzc$class_foobar:<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &nbsp; static function $init$() { }<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; And insert code into the LzApplication's constuctor():<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &nbsp; $lzc$class_foobar.$init$();<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; (This is all done manually for debugging).<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Now when I compile I start getting errors:<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; /Users/clients/laszlo/lib/jakarta-tomcat-5.0.30/temp/lzswf9/<br> &gt;&gt;&gt; lzgen23563/$lzc$class_foobar.as(6):<br> &gt;&gt;&gt; col: 89 Error: Type was not found or was not a compile-time<br> &gt;&gt;&gt; constant:<br> &gt;&gt;&gt; boolean.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; function $lzc$class_foobar (parent:LzNode, attrs:Object,<br> &gt;&gt;&gt; children:Object? = null, async:boolean = null)<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; So boolean = null should be Boolean = false &nbsp;(is this something<br> &gt;&gt;&gt; generated by tag compiler?)<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; 4) fixing that gets a clean compile, but same behavior (blank<br> &gt;&gt;&gt; canvas).<br> &gt;&gt;&gt; I suspect it's something to do with 2) above - somehow we need<br> &gt;&gt;&gt; to register the 'foobar' class so it can be instantiated at<br> &gt;&gt;&gt; runtime as<br> &gt;&gt;&gt; needed.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Henry - I think these issues need your expertise, but if there's<br> &gt;&gt;&gt; something<br> &gt;&gt;&gt; I can assist with, shout. &nbsp;BTW, my cell is 617-306-2057, feel free<br> &gt;&gt;&gt; to<br> &gt;&gt;&gt; call.<br> &gt;&gt;&gt; I'll be reading email too.<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; - Don<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; On Mar 27, 2008, at 1:20 PM, Henry Minsky wrote:<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; with this test case<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &lt;canvas width="1000" height="600" bgcolor="#eeeeff"&gt;<br> &gt;&gt;&gt; &nbsp;&lt;class name="foobar" &gt;<br> &gt;&gt;&gt; &nbsp; &nbsp;&lt;view width="50" height="50" bgcolor='red'/&gt;<br> &gt;&gt;&gt; &nbsp; &nbsp;&lt;view y="50" x="75" width="100" height="50" bgcolor='blue'/&gt;<br> &gt;&gt;&gt; &nbsp;&lt;/class&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &nbsp;&lt;foobar x="100"/&gt;<br> &gt;&gt;&gt; &nbsp;&lt;foobar x="200" y="200"/&gt;<br> &gt;&gt;&gt; &nbsp;&lt;foobar x="300" y="400"/&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; &lt;/canvas&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; I get this compiler error in swf9<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; lzc --runtime=swf9 hello-classes.lzx<br> &gt;&gt;&gt; Compiling: hello-classes.lzx to hello-classes.lzr=swf9.swf<br> &gt;&gt;&gt; Compilation errors occurred:<br> &gt;&gt;&gt; : org.openlaszlo.sc.CompilerError: $lzc$class_foobar: class or mixin<br> &gt;&gt;&gt; name may conflict with internally generated names<br> &gt;&gt;&gt; badtzmaru:swf9 hqm$<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; --<br> &gt;&gt;&gt; Henry Minsky<br> &gt;&gt;&gt; Software Architect<br> &gt;&gt;&gt; <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; --<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; Don Anderson<br> &gt;&gt;&gt; Java/C/C++, Berkeley DB, systems consultant<br> &gt;&gt;&gt;<br> &gt;&gt;&gt; voice: 617-547-7881<br> &gt;&gt;&gt; email: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br> &gt;&gt;&gt; www: <a href="http://www.ddanderson.com" target="_blank">http://www.ddanderson.com</a><br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;&gt;<br> &gt;&gt;<br> &gt;&gt;<br> &gt;&gt; --<br> &gt;&gt; Henry Minsky<br> &gt;&gt; Software Architect<br> &gt;&gt; <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br> &gt;&gt;<br> &gt;&gt;<br> &gt;<br> &gt;<br> &gt; --<br> &gt; Henry Minsky<br> &gt; Software Architect<br> &gt; <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br> <br> </div></div></blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline">--</div><div><br class="webkit-block-placeholder"></div><div>Don Anderson</div><div>Java/C/C++, Berkeley DB, systems consultant</div><div><br class="webkit-block-placeholder"></div><div>voice: 617-547-7881</div><div>email:&nbsp;<a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a></div><div>www: <a href="http://www.ddanderson.com">http://www.ddanderson.com</a></div><div><br class="webkit-block-placeholder"></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"> </div><br></div></div></body></html>