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

Rosetta Example: Respond to an unknown method call

-
- -
-
-
package req nx
-

Define a class Example modelled after the -Python version of Rosetta:

-
-
-
nx::Class create Example {
-
-  :public method foo {} {return "This is foo."}
-  :public method bar {} {return "This is bar."}
-
-  :method unknown {method args} {
-    set result "Tried to handle unknown method '$method'."
-    if {[llength $args] > 0} {
-      append result " It had arguments '$args'."
-    }
-    return $result
-  }
-}
-
-

Demonstrating the behavior in a shell:

-

Create an instance of the class Example:

-
-
-
% set e [Example new]
-
-% $e foo
-This is foo.
-
-% $e bar
-This is bar.
-
-% $e grill
-Tried to handle unknown method 'grill'.
-
-% $e ding dong
-Tried to handle unknown method 'ding'. It had arguments 'dong'.
-
-
-
-
-

- - - + + + + + +Listing of doc/example-scripts/rosetta-unknown-method.tcl + + + + + +
+
+

Rosetta Example: Respond to an unknown method call

+
+ +
+
+
package req nx
+

Define a class Example modelled after the +Python version of Rosetta:

+
+
+
nx::Class create Example {
+
+  :public method foo {} {return "This is foo."}
+  :public method bar {} {return "This is bar."}
+
+  :method unknown {method args} {
+    set result "Tried to handle unknown method '$method'."
+    if {[llength $args] > 0} {
+      append result " It had arguments '$args'."
+    }
+    return $result
+  }
+}
+
+

Demonstrating the behavior in a shell:

+

Create an instance of the class Example:

+
+
+
% set e [Example new]
+
+% $e foo
+This is foo.
+
+% $e bar
+This is bar.
+
+% $e grill
+Tried to handle unknown method 'grill'.
+
+% $e ding dong
+Tried to handle unknown method 'ding'. It had arguments 'dong'.
+
+
+
+
+

+ + +