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

Rosetta Example: Classes

-
- -
-
-
package req nx
-
-nx::Class create summation {
-  :method init {} {set :v 0}
-  :public method add {x} {incr :v $x}
-  :public method value {} {return ${:v}}
-  :public method destroy {} {puts "ended with value [:value]"; next}
-}
-
-

Demonstrating the behavior in a shell:

-
-
-
% set sum [summation new]
-% $sum value
-0
-% $sum add 1
-1
-% $sum add 2
-3
-% $sum add 3
-6
-% $sum add 4
-10
-% $sum value
-10
-

During the destroy of the object, ended with value 10 is printed

-
-
-
% $sum destroy
-
-
-
-
-

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

Rosetta Example: Classes

+
+ +
+
+
package req nx
+
+nx::Class create summation {
+  :method init {} {set :v 0}
+  :public method add {x} {incr :v $x}
+  :public method value {} {return ${:v}}
+  :public method destroy {} {puts "ended with value [:value]"; next}
+}
+
+

Demonstrating the behavior in a shell:

+
+
+
% set sum [summation new]
+% $sum value
+0
+% $sum add 1
+1
+% $sum add 2
+3
+% $sum add 3
+6
+% $sum add 4
+10
+% $sum value
+10
+

During the destroy of the object, ended with value 10 is printed

+
+
+
% $sum destroy
+
+
+
+
+

+ + +