<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Phil,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I agree with you - that case I think is nonsensical.  I was going to get some more wisdom</DIV><DIV>by experimenting with the flex compiler, but it doesn't support ! or ? in types.</DIV><DIV>At all - syntax error.  These cases are shown in the ECMAScript 4</DIV><DIV>Language Overview final draft, but that's not a standard yet, so maybe</DIV><DIV>nobody is implementing it.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>BTW, there will be many other cases in this area that we cannot catch in the grammar,</DIV><DIV>like basic type snafus:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>   var v_typed_q:int = "hello";</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>and is this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>   var v:int! = 1;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>even valid?  (A primitive type like int may not accept nullability - it wouldn't make sense in Java).</DIV><DIV>My first temptation is to accept any such cases in our grammar and let the backend compiler flag them</DIV><DIV>as errors for us.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>But given that the language feature isn't in flex, I'm not sure what to do, leave '!' '?'</DIV><DIV>in for a future day, or take them out.  ?!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Tucker - opinion on this?  Am I wrong to be looking at the ECMAScript 4 overview?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- Don</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On Nov 7, 2007, at 8:22 PM, Philip Romanik wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> Approved. <BR><BR> If I write this line of code, no error is generated, but it doesn't seem right. Is this legal ecma4?<BR><BR>       var v_typed_q:?int! = 123;<BR><BR> <BR> (Perhaps somebody else can chime in here. Is /test/lztest still the preferred way to write a unit test? If so, this test can be converted into lztest format.)<BR><BR> <BR> <BLOCKQUOTE type="cite" class="cite" cite="">Change 20071107-dda-g by <A href="mailto:dda@freddie.local">dda@freddie.local</A> on 2007-11-07 18:14:27 EST<BR>      in /Users/dda/laszlo/src/svn/openlaszlo/trunk<BR>      for <A href="http://svn.openlaszlo.org/openlaszlo/trunk"> http://svn.openlaszlo.org/openlaszlo/trunk</A><BR>  <BR> Summary: Allow type information for vars, even though ignored in<BR> SWF7/8 and DHTML.<BR>  <BR> New Features:<BR>      Allow type information accepted in ActionScript 3.0, that is:<BR>        var x:int;<BR>        var y:String = "hello";<BR>        var z:?String = null;   // ? means can set to null (default)<BR>        var z:String! = "bonjour";   // ! means cannot set to null<BR>      Please note that the type information is merely accepted as part of the language, and ignored for now.<BR>  <BR> Bugs Fixed: LPP-5059<BR>  <BR> Technical Reviewer: ptw<BR> QA Reviewer: philip<BR> Doc Reviewer: (pending)<BR>  <BR> Documentation:<BR>     Requires documentation if we describe in detail our language (or subset).  If we point<BR>     users to the published standards, then we can continue to do that.<BR>     We should note that type information is ignored except for the<BR> (upcoming) SWF9 runtime.<BR>  <BR> Release Notes:<BR>      Variables declared using the 'var' statement now allow type specifications as<BR>      described by Ecmascript 4 (that is, ActionScript 3.0).<BR>  <BR> Details:<BR>      No type checking is done by the SWF7/8 and DHTML runtimes (nor is planned), any<BR>      type information is thrown away.  However, when SWF9 is available, the type information<BR>      will be accepted and passed through to the 3rd party SWF9 compiler, which will do type<BR>      checking for any variable with type information.  This change allows users and developers<BR>      to write code that can be useful with either runtime.  Even if they don't use with SWF9,<BR>      this is a useful feature for self documenting usage of variables.<BR>  <BR>      We currently allow type information on 'var' declarations, also method parameters and<BR>      method return values.  I believe only information for 'var'  <BR> declarations can be done<BR>      in .lzx, but the latter two are also accepted (and ignored for current runtimes) in .lzs files.<BR>  <BR> Tests:<BR>      Ran new test test/typevar.lzx for both SWF7/8 and DHTML, to make sure syntax is accepted.<BR>      Ran smokecheck.lzx to assure there are no regressions.<BR>  <BR> Files:<BR> A      test/typevar.lzx<BR> M      WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt<BR> M      WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ <BR> ASTIdentifier.java<BR>  <BR> Changeset: <A href="http://svn.openlaszlo.org/openlaszlo/patches/20071107-dda-"> http://svn.openlaszlo.org/openlaszlo/patches/20071107-dda-</A><BR> g.tar<BR>  <BR>  <BR>  <BR> --<BR>  <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>  </BLOCKQUOTE> </BLOCKQUOTE></DIV><BR><DIV> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">--</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Don Anderson</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Java/C/C++, Berkeley DB, systems consultant</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Voice:<SPAN class="Apple-converted-space">  </SPAN>617-547-7881</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Email:<SPAN class="Apple-converted-space">  </SPAN><A href="mailto:dda@ddanderson.com">dda@ddanderson.com</A></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">WWW:<SPAN class="Apple-converted-space">    </SPAN><A href="http://www.ddanderson.com">http://www.ddanderson.com</A></FONT></P>  </DIV><BR></DIV></BODY></HTML>