Index: doc/example-scripts/rosetta-delegates.html =================================================================== diff -u -r24cb8f4bffd49c9375c1c64aa0610933b62511bb -rc4f449cb353be812ba6502ef8e9587e87881f59b --- doc/example-scripts/rosetta-delegates.html (.../rosetta-delegates.html) (revision 24cb8f4bffd49c9375c1c64aa0610933b62511bb) +++ doc/example-scripts/rosetta-delegates.html (.../rosetta-delegates.html) (revision c4f449cb353be812ba6502ef8e9587e87881f59b) @@ -1,829 +1,829 @@ - - - - - -Listing of doc/example-scripts/rosetta-delegates.tcl - - - - - -
-
-

Rosetta Example: Delegates

-
- -
-
-
package req nx
-
-nx::Class create Delegator {
-
-  # The class Delegator has a property named "delegatee" which is an
-  # object:
-
-  :property delegatee:object
-
-  # The method "operation" decides, whether it deletates the action to
-  # another object, or it performs the action itself.
-
-  :public method operation {} {
-    if {[info exists :delegatee]} {
-      ${:delegatee} operation
-    } else {
-      return "default implementatiton"
-    }
-  }
-}
-
-nx::Class create Delegatee {
-
-  # The class "Delgatee" might receice invocations from the class
-  # "Delegator"
-
-  :public method operation {} {
-    return "delegatee implementatiton"
-  }
-}
-
-

Demonstrating the behavior in a shell:

-

Create a Delegator, which has no delegatee defined. Therefore -delegator performs the action by itself, the default implementation.

-
-
-
% set a [Delegator new]
-% $a operation
-default implementatiton
-

Now, we set the delegatee; therefore, the delegatee will perform -the action.

-
-
-
% $a configure -delegatee [Delegatee new]
-% $a operation
-delegatee implementatiton
-
-
-
-
-

- - - + + + + + +Listing of doc/example-scripts/rosetta-delegates.tcl + + + + + +
+
+

Rosetta Example: Delegates

+
+ +
+
+
package req nx
+
+nx::Class create Delegator {
+
+  # The class Delegator has a property named "delegatee" which is an
+  # object:
+
+  :property delegatee:object
+
+  # The method "operation" decides, whether it deletates the action to
+  # another object, or it performs the action itself.
+
+  :public method operation {} {
+    if {[info exists :delegatee]} {
+      ${:delegatee} operation
+    } else {
+      return "default implementatiton"
+    }
+  }
+}
+
+nx::Class create Delegatee {
+
+  # The class "Delgatee" might receice invocations from the class
+  # "Delegator"
+
+  :public method operation {} {
+    return "delegatee implementatiton"
+  }
+}
+
+

Demonstrating the behavior in a shell:

+

Create a Delegator, which has no delegatee defined. Therefore +delegator performs the action by itself, the default implementation.

+
+
+
% set a [Delegator new]
+% $a operation
+default implementatiton
+

Now, we set the delegatee; therefore, the delegatee will perform +the action.

+
+
+
% $a configure -delegatee [Delegatee new]
+% $a operation
+delegatee implementatiton
+
+
+
+
+

+ + +