I think this predates that change, but I&#39;ll check the &#39;publish&#39; flag logic <br><br><div class="gmail_quote">On Tue, Nov 24, 2009 at 6:43 PM, P T Withington <span dir="ltr">&lt;<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">That&#39;s a bug then.  Perhaps this has the same root as the regression you just fixed?<br>

<br>
Nothing should go in lz unless it is really defining a tag.<br>
<div><div></div><div class="h5"><br>
On 2009-11-24, at 18:23, Henry Minsky wrote:<br>
<br>
&gt; Hmm, now that you mention it,  I notice we&#39;ve been adding the interstitial<br>
&gt; class names that come from compiling class mixins to the lz namespace<br>
&gt; object:<br>
&gt;<br>
&gt; lz[&quot;colored_square$view&quot;] = $lzc$class_colored_square$view;<br>
&gt; lz[&quot;black_line$colored_square$view&quot;] =<br>
&gt; $lzc$class_black_line$colored_square$view;<br>
&gt;<br>
&gt;<br>
&gt; I don&#39;t think we need them in there, do we? The compiler seems to be<br>
&gt; emitting<br>
&gt; calls to instantiate the objects directly using the classname when it calls<br>
&gt; LzInstantiateView e.g.,<br>
&gt;<br>
&gt; &quot;class&quot;: $lzc$class_black_line$colored_square$view<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Nov 24, 2009 at 5:36 PM, P T Withington &lt;<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; On 2009-11-24, at 17:01, Rami Ojares / AMG Oy wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Current documentation has this to say about node&#39;s createChildren(carr)<br>
&gt;&gt; argument<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &quot;an array of children where the structure of each child [c] takes the<br>
&gt;&gt; form:<br>
&gt;&gt;&gt; <a href="http://c.name" target="_blank">c.name</a> = a string containing the name of the child -- usually its<br>
&gt;&gt; constructor<br>
&gt;&gt;&gt; c.args = a dictionary of attributes and values to be passed to the<br>
&gt;&gt; constructor of that child<br>
&gt;&gt;&gt; c.children = an array of children for the new child&quot;<br>
&gt;&gt;<br>
&gt;&gt; You are venturing into things that most people don&#39;t, since they just use<br>
&gt;&gt; the XML language for their applications.<br>
&gt;&gt;<br>
&gt;&gt; I think the documentation on makeChild is more accurate.  createChildren is<br>
&gt;&gt; really just a hook to allow a subclass to change where and when it actually<br>
&gt;&gt; makes its children.  makeChild is the interface that actually interprets the<br>
&gt;&gt; children specification.  (Don&#39;t blame me for the confusing names, I did not<br>
&gt;&gt; make them up!)<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://c.name" target="_blank">c.name</a> is still valid, it is used to make a child be of the class that<br>
&gt;&gt; implements a particular tag (so you say &#39;view&#39; to get a &lt;view&gt;, etc.  You<br>
&gt;&gt; can use this to make any node that has a tag).<br>
&gt;&gt;<br>
&gt;&gt; c.class is an optimization, used by the compiler to:<br>
&gt;&gt;<br>
&gt;&gt; 1) Avoid having to look up the name<br>
&gt;&gt; 2) Instantiate &#39;instance classes&#39;<br>
&gt;&gt;<br>
&gt;&gt;&gt; None of this seems to be true.<br>
&gt;&gt;&gt; Instead the children seems to have the structure:<br>
&gt;&gt;&gt; c.attrs = a dictionary of attributes and values to be passed to the<br>
&gt;&gt; constructor of that child<br>
&gt;&gt;&gt; c.class = pointer to the class to be instantiated<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; When you further inspect the class there is one useful attribute:<br>
&gt;&gt;&gt; tagname. That seems to have the same function as <a href="http://c.name" target="_blank">c.name</a> in the above<br>
&gt;&gt; mentioned documentation.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Further it seems that in the current trunk if you instantiate a class<br>
&gt;&gt; with a constrained attribute like this<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &lt;view height=&quot;${foo.height}&quot;/&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It&#39;s tagname becomes<br>
&gt;&gt;&gt; &quot;anonymous tagname&quot;<br>
&gt;&gt;<br>
&gt;&gt; Right.  This is a so-called &quot;instance class&quot;.  In order to have a<br>
&gt;&gt; constraint, an instance needs some supporting methods.  (You would see the<br>
&gt;&gt; same thing if you gave your instance an explicit &lt;method&gt;.)  In order to<br>
&gt;&gt; have methods, the compiler has to build a class, and then make just one<br>
&gt;&gt; instance of that class.  It doesn&#39;t define a tag for that class, because it<br>
&gt;&gt; will only ever be made by the compiler (or by replication, which works<br>
&gt;&gt; automatically).  The tagname in this case, is just for debugging.  If you<br>
&gt;&gt; were to look at the non-debug version, you would see the tagname is not<br>
&gt;&gt; emitted.  And of course, the class is _not_ entered into `lz` (as are all<br>
&gt;&gt; real class definitions, e.g., lz[&#39;view&#39;] =&gt; the class that implements<br>
&gt;&gt; &lt;view&gt;, so lz[&lt;any tag name&gt;].tagname == &lt;any tag name&gt;, but not for<br>
&gt;&gt; &#39;anonymous&#39; or &#39;instance&#39; classes.)<br>
&gt;&gt;<br>
&gt;&gt;&gt; Code:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &lt;canvas debug=&quot;true&quot;&gt;<br>
&gt;&gt;&gt;   &lt;view &gt;<br>
&gt;&gt;&gt;       &lt;method name=&quot;createChildren&quot; args=&quot;children&quot;&gt;&lt;![CDATA[<br>
&gt;&gt;&gt;           for(var i=0; i&lt;children.length; i++) {<br>
&gt;&gt;&gt;               Debug.write(children[i][&#39;class&#39;].tagname);<br>
&gt;&gt;&gt;           }<br>
&gt;&gt;&gt;       ]]&gt;&lt;/method&gt;<br>
&gt;&gt;&gt;       &lt;view height=&quot;${canvas.height}&quot;/&gt;<br>
&gt;&gt;&gt;       &lt;view/&gt;<br>
&gt;&gt;&gt;   &lt;/view&gt;<br>
&gt;&gt;&gt; &lt;/canvas&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Produces the output in debug window:<br>
&gt;&gt;&gt; anonymous view<br>
&gt;&gt;&gt; view<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Is this how it is supposed to be?<br>
&gt;&gt;<br>
&gt;&gt; That&#39;s how it is supposed to be.  :)<br>
&gt;&gt;<br>
&gt;&gt;&gt; Or is this an accident caused by the instance specific mixin development?<br>
&gt;&gt;<br>
&gt;&gt; Although, we did just add this feature to make it easier to debug instance<br>
&gt;&gt; mixin&#39;s.  Before, we never emitted a tagname for &quot;instance classes&quot;.  But we<br>
&gt;&gt; decided it would help debugging to give them a tagname that told what tag<br>
&gt;&gt; they were derived from.<br>
&gt;&gt;<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><br>