<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 21, 2008, at 1:01 PM, P T Withington wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Great stuff!<br><br>Comments:<br><br>1) Our idiom for undefined is `void 0`, because of (<a href="http://tinyurl.com/2z3q2o">http://tinyurl.com/2z3q2o</a>), </div></blockquote><div><br></div><div>On an existing line with 'return void(0);' , I got a flex error about mismatching type.</div><div>I think I changed this to return LzReplicationManager(0) but I got a test failure. Quite possibly</div><div>it was in DHTML only, so maybe '0 cast LzReplicationManager' would fix it.</div><div>(My fix was 'return this' - it got past the compiler and seemed to pass the errant test).</div><div><br></div><blockquote type="cite"><div>OTOH, in the case of return, shouldn't you be able to say simply `return ;` to return undefined, since `;` is an empty expression whose value is undefined. Is it us or Flex that says that is an error?</div></blockquote><div><br></div><div>Flex error.</div><br><blockquote type="cite"><div>OTOOH, in the case of returning undefined for a typed method, is flex just coercing undefined to the type's null? E.g.:<br><br> lzx> (function ():Boolean { return void 0; })()<br> false<br><br>Says to me you might as well just return `false`.</div></blockquote><div><br></div><div>In (at least one) case of Boolean , I did have to return false to get tests to work. Given this, I will change all Boolean</div><div>functions to return false wherever I put in undefined before.</div><br><blockquote type="cite"><div> OTOOOH, Flex does not seem to coerce undefined to null for subtypes of Object. Curious.<br><br>2) toString has a much larger problem, since it is intending to override the Object.toString method, but will not unless it is marked public, and if it is, it will then need to match the signature of the base method. Please file a separate bug to repair toString, if one does not already exist.</div></blockquote><div><br></div>Alright</div><div><br><blockquote type="cite"><div>3) André's point: don't use classes as functions to cast. It's not reliable.<br></div></blockquote><div><br></div>Yes, I'll fix that.</div><div><br><blockquote type="cite"><div>4) In LzReplicationManager, if we can't figure out what is going on, please file a bug. It looks to me like the type declaration is too narrow, that it should be LzNode not LzView. (Pet peeve of mine: the frickin' compiler knows the type I should be declaring, why should I have to tell it?)</div></blockquote><div><br></div><div>Okay, I'll file a JIRA</div><div><br></div><blockquote type="cite"><div><br>5) I don't understand the change in the return value of __LZHandleMultiNodes. This seems like a semantic change that needs a separate bug?</div></blockquote><div><br></div><div>Okay, I'll file a JIRA</div><div><br></div><br><blockquote type="cite"><div>6) Another point by André: For undefined Number results it would be more accurate to return NaN.<br><br></div></blockquote><br>Yes, I'll fix that.</div><div><br><blockquote type="cite"><div>7) swf9/LzDebug remove the @devnote now that you have addressed the bug</div></blockquote><br></div><div>Okay.</div><div><br><blockquote type="cite"><div>Otherwise, approved.<br><br></div></blockquote><div><br></div>Also, since I needed to change lzpix application code to add a return type for an overridden method,</div><div>I think we'll need to make a run-through all the sample apps before the release goes out.</div><div>Though that seems to be the only occurrence of isMultiSelect() in the demos directory.</div><div><br></div><div>Thanks,</div><div><br></div><div>- Don</div><div><br></div><div><blockquote type="cite"><div>On 2008-10-21, at 10:54EDT, Donald Anderson wrote:<br><br><blockquote type="cite">Change 20081021-dda-p by <a href="mailto:dda@lester.local">dda@lester.local</a> on 2008-10-21 10:03:53 EDT<br></blockquote><blockquote type="cite"> in /Users/dda/laszlo/src/svn/openlaszlo/trunk-a<br></blockquote><blockquote type="cite"> for <a href="http://svn.openlaszlo.org/openlaszlo/trunk">http://svn.openlaszlo.org/openlaszlo/trunk</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Summary: Add return type declarations to SWF9<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">New Features:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Bugs Fixed: LPP-7031 (swf9 back-end is dropping return type declarations)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Technical Reviewer: ptw (pending)<br></blockquote><blockquote type="cite">QA Reviewer: promanik (pending)<br></blockquote><blockquote type="cite">Doc Reviewer: (pending)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Documentation:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Release Notes:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Details:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java<br></blockquote><blockquote type="cite"> WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9ParseTreePrinter.java<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> Explicit return types like Boolean in 'function foo () : Boolean { }' were<br></blockquote><blockquote type="cite"> not being emitted by the SWF9 backend. The fix was straightforward,<br></blockquote><blockquote type="cite"> the fallout was not...<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java<br></blockquote><blockquote type="cite"> WEB-INF/lps/server/src/org/openlaszlo/sc/Method.java<br></blockquote><blockquote type="cite"> WEB-INF/lps/server/src/org/openlaszlo/sc/Function.java<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> Added a "type" attribute to <method> to set the return type.<br></blockquote><blockquote type="cite"> This was needed to get a few cases where lzx code overrides LFC functions (now with return typing!)<br></blockquote><blockquote type="cite"> to compile. This type must be 'Javascript' (i.e. Boolean, not 'boolean' is used).<br></blockquote><blockquote type="cite"> Some cleanup to reduce the number of constructors for Method/Function. I think<br></blockquote><blockquote type="cite"> this makes the code a bit clearer.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> lps/components/base/datalistselector.lzx<br></blockquote><blockquote type="cite"> lps/components/base/listselector.lzx<br></blockquote><blockquote type="cite"> demos/lzpix/app.lzx<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> Added type="Boolean" to a few methods that override to allow them to compile and<br></blockquote><blockquote type="cite"> run in SWF9.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> Fixing return typing exposed a lot of 'new' typing in LFC and some in application code,<br></blockquote><blockquote type="cite"> which caused various consistency errors in several categories.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> - in many .lzs files, functions marked as returning a type did not always<br></blockquote><blockquote type="cite"> explicitly call return, or when they did they did not return a value.<br></blockquote><blockquote type="cite"> Initially, I tried to make intelligent guesses about values returned (favoring 'null'),<br></blockquote><blockquote type="cite"> but testing revealed many problems. Ultimately, I needed to be<br></blockquote><blockquote type="cite"> very conservative, returning 'undefined' in most cases, and false<br></blockquote><blockquote type="cite"> for Boolean functions. This seems to be the default behavior for JS<br></blockquote><blockquote type="cite"> when returns are missing values. Cases that seemed most questionable<br></blockquote><blockquote type="cite"> I marked with:<br></blockquote><blockquote type="cite"> TODO: [20081020 dda] review this return value change from LPP-7031<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> - in several .lzs files, functions marked as override did not always match return types.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> - in several .lzs files, toString() is marked as :String, but in others it is not.<br></blockquote><blockquote type="cite"> For the moment, it was too big of a job to fix all these as part of this (already<br></blockquote><blockquote type="cite"> large) commit, so typing for this function was commented whenever a<br></blockquote><blockquote type="cite"> compile error showed a mismatch.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> - in several .lzs files, functions with new typing returned a value but without proper typing.<br></blockquote><blockquote type="cite"> Type casting was added as appropriate.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> - type of a local variable wasn't narrowly typed enough, leading to<br></blockquote><blockquote type="cite"> errors in return statements.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> WEB-INF/lps/lfc/debugger/LzDebug.lzs:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> - __StringDescription() needed to be defined with exactly the same argument signature<br></blockquote><blockquote type="cite"> I don't know why return typing exposed this as a problem.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> - Certain local variables typed as LzView needed typing commented. Initial attempts<br></blockquote><blockquote type="cite"> to fix the typing errors in this file involved casting, e.g.<br></blockquote><blockquote type="cite"> var v:LzView = LzView(this.getNewClone( true ));<br></blockquote><blockquote type="cite"> But these changes broke smokecheck for DHTML. It seems that some assumption<br></blockquote><blockquote type="cite"> about typing is being violated and will need to be tracked down later.<br></blockquote><blockquote type="cite"> I commented out the typing for the local variables, and left TODOs to clean<br></blockquote><blockquote type="cite"> this up later.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> Note that the compile errors fixed here only show up when building the LFC (or app) for SWF9.<br></blockquote><blockquote type="cite"> In debugging these problems it was most helpful to build the debuglfc to get line number information.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Tests:<br></blockquote><blockquote type="cite"> tests: (smokecheck) * (swf8+dhtml)<br></blockquote><blockquote type="cite"> apps: (weather+lzpix) * (swf8+swf9+dhtml), hello(swf9)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Files:<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/services/LzAudio.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/debugger/LzDebug.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/debugger/platform/swf9/LzFlashRemote.as<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/debugger/platform/swf9/LzDebug.as<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/views/LaszloView.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzLazyReplicationManager.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzReplicationManager.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzDatapointer.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzDataText.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzDataNode.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzDataElement.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzDatapath.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzParam.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/data/LzDataAttrBind.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/lfc/compiler/LzBootstrapDebugService.lzs<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/sc/Method.java<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9ParseTreePrinter.java<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/sc/Function.java<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java<br></blockquote><blockquote type="cite">M lps/components/base/datalistselector.lzx<br></blockquote><blockquote type="cite">M lps/components/base/listselector.lzx<br></blockquote><blockquote type="cite">M demos/lzpix/app.lzx<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Changeset: <a href="http://svn.openlaszlo.org/openlaszlo/patches/20081021-dda-p.tar">http://svn.openlaszlo.org/openlaszlo/patches/20081021-dda-p.tar</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Don Anderson<br></blockquote><blockquote type="cite">Java/C/C++, Berkeley DB, systems consultant<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">voice: 617-547-7881<br></blockquote><blockquote type="cite">email: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br></blockquote><blockquote type="cite">www: <a href="http://www.ddanderson.com">http://www.ddanderson.com</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br></div></blockquote></div><br><div> <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; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><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; "><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; "><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>Don Anderson<br>Java/C/C++, Berkeley DB, systems consultant<br><br>voice: 617-547-7881<br>email: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br>www: <a href="http://www.ddanderson.com/">http://www.ddanderson.com</a><br></div></div></span></span><br class="Apple-interchange-newline"></div></span></div></span><br class="Apple-interchange-newline"> </div><br></body></html>