[Laszlo-checkins] r11954 - openlaszlo/trunk/docs/src/developers
lou@openlaszlo.org
lou at openlaszlo.org
Tue Dec 2 04:15:15 PST 2008
Author: lou
Date: 2008-12-02 04:14:53 -0800 (Tue, 02 Dec 2008)
New Revision: 11954
Modified:
openlaszlo/trunk/docs/src/developers/classes-powerprogramming.dbk
Log:
Change 20081202-lou-1 by lou at loumac.local on 2008-12-02 08:06:38 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: dguide, Chapter 33. Extending Classes: add section 4. <mixin>s
Bugs Fixed: LPP-5062
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: tucker
Details: add Tucker's documentation section from LPP-2302
Tests: visual verify
Modified: openlaszlo/trunk/docs/src/developers/classes-powerprogramming.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/classes-powerprogramming.dbk 2008-12-02 12:13:49 UTC (rev 11953)
+++ openlaszlo/trunk/docs/src/developers/classes-powerprogramming.dbk 2008-12-02 12:14:53 UTC (rev 11954)
@@ -274,13 +274,42 @@
<para>
will not have classroot defined.</para>
+<para/></section></section>
+ <section id="mixins">
+ <title><literal><mixin></literal>s</title>
+ <para><literal><mixin></literal> is like <literal><class></literal>
+ but rather than creating something you can instantiate, <literal><mixin></literal> creates a template that can be
+ <emphasis>mixed in</emphasis> (added to) more than one other class. A
+ <literal><mixin></literal> is like an interface, but it is allowed to have
+ state and implementation. </para>
+
+ <para><literal><mixin></literal> is an advanced feature. To add a
+ <literal><mixin></literal> to a class you say: </para>
+
+<programlisting>
+ <class name="icecream" ... />
+ <class name="walnuts" ... />
+
+ <mixin name="toppings">
+ <attribute name="sauce" type="color" value="lavender" />
+ <attribute name="whippedcream" type="boolean" value="true" />
+ <attribute name="cherry" type="boolean" value="true" />
+ ...
+ </mixin>
+
+ <class name="sundae" extends="icecream" with="toppings />
+
+ <sundae name="chocfulla"
+ flavor="honeydew"
+ sauce="lemonchiffon">
+ <walnuts ground="true" />
+ </sundae> </programlisting>
+
+ <para>See <literal>tests/mixins.lzx</literal> for a more complete example.</para>
+ </section>
+<section><title>Declared text</title>
-
-
-
-<para/></section></section><section><title>Declared text</title>
-
<para>The <indexterm><primary>text</primary></indexterm><sgmltag class="element"><text></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: text-->
and <indexterm><primary>inputtext</primary></indexterm><sgmltag class="element"><inputtext></sgmltag><remark role="fixme">[unknown tag]</remark>
More information about the Laszlo-checkins
mailing list