Index: doc/migration1-2.html =================================================================== diff -u -r734813e4825bba23aed9d8a689e670c4ca93a818 -re9e005a37cea3695128c401e819b95d128bee52d --- doc/migration1-2.html (.../migration1-2.html) (revision 734813e4825bba23aed9d8a689e670c4ca93a818) +++ doc/migration1-2.html (.../migration1-2.html) (revision e9e005a37cea3695128c401e819b95d128bee52d) @@ -10,7 +10,7 @@ color: black; } table i { - font-size: 80%; + font-size: 85%; } table td code i { font-style: italic; @@ -132,6 +132,10 @@

Defining Methods

+ +

Scripted Methods Defined in the Init-block of a Class/Object or with +Separate Calls

+ @@ -140,7 +144,7 @@ C proc bar args {...}
+
XOTclNext Scripting Language
- # Define method and object method in the init-block of a class

+ # Define method and object method
# in the init-block of a class


Class create C {
  :method foo args {...}
  :object method bar args {...}
@@ -170,73 +174,170 @@ o method foo args {...}
+ +

Define Different Kinds of Methods

+ + + - + + + + + - - + - - + + + + - + + + + + + +
XOTclNext Scripting Language
# method modifiers "object", "public" and - "protected"
# are not available.


+
+ # Methods for defining methods:
#
+ #     proc
+ #     instproc
+ #     forward
+ #     instforward
+ #     parametercmd
+ #     instparametercmd
+
+
+ # Methods for defining methods:
#
+ #     method
+ #     forward
+ #     setter
+ #     alias
+ #     attribute
+
+
Class C
C instproc foo args {...}
- C proc bar args {...}
+ C proc bar args {...}

+ Object o
+ o proc baz args {...}
- # Define scripted methods with various method modifiers

+ # Define scripted methods

Class create C {
-   :method foo1 args {...}
-   :public method foo2 args {...}
-   :protected method foo3 args {...}
-   :object method bar1 args {...}
-   :protected object method bar2 args {...}
-   :public object method bar3 args {...}
+   :method foo args {...}
+   :object method bar args {...}
+ }

+ Object create o {
+   :method baz args {...}
}
# method modifiers "object", "public" and - "protected"
# are not available.


+ +
Class C
- C instforward f1 ...
- C proc of1 ...
+ C instforward f1 ...
+ C forward f2 ...

+ Object o
+ o forward f3 ...
- # Define forwarder with various method modifiers

+ # Define forwarder

Class create C {
  :forward f1 ...
-   :public forward f2 ...
-   :protected forward f3 ...
-   :object forward of1 ...
-   :public object forward of2 ...
-   :protected object forward of3 ...
- }
+   :object forward f2 ...
+ }

+ Object create o {
+   :forward f3 ...
+ }
# method modifiers "object", "public" and - "protected"
# are not available.


+ +
Class C
- C instparametercmd s1 ...
- C parametercmd os1 ...
+ C instparametercmd p1
+ C parametercmd p2

+ Object o
+ o parametercmd p3
- # Define setters with various method modifiers

+ # Define setter and getter methods

Class create C {
-   :setter s1 ... {...}
-   :public setter s2 ...
-   :protected setter s3 ...
-   :object setter os1 ... {...}
-   :public object setter os2 ...
-   :protected object setter os3 ...
- }
-
- # TODO: same for "alias" und "attribute" -- - mybe more generic, with placeholder for "method", "forward", - "setter", "alias" and "attribute" +   :setter p1 ?value_constraint?
+   :object setter p2 ?value_constraint?
+ }

+ Object create o {
+   :setter p3 ?value_constraint?
+ }
+
+ # Method "alias" not available

+ # Define method aliases (to scripted or + non-scripted methods)

+ Class create C {
+   :alias a1 ...
+   :object alias a2 ...
+ }

+ Object create o {
+   :alias a3 ...
+ }
+
+ # Parameters only available at class level

+ Class C \
   -parameter {
+     x
+     {y 1}
+
}
+
+
+ # Define object attributes
#(parameters for initializing objects)


+ Class create C {
+   :attribute x
+   :attribute {y 1}
+   :object attribute oa1
+ }

+ Object create o {
+   :attribute oa2
+ }
+
+

Method Modifiers and Method Protection

+ + + + + + + + + +
XOTclNext Scripting Language
# Method modifiers
+ #
+ #   "object",
+ #   "public", and
+ #   "protected"
+ #
+ # are not available.


+
+ # Method modifiers orthogonal over all kinds of methods
+ #
+ # Method-definition-methods:
+ #    method, forward, setter, alias, attribute +


+ Class create C {
+   :method-definiton-method ...
+   :public method-definiton-method ...
+   :protected method-definiton-method ...
+   :object method-definiton-method ...
+   :protected object method-definiton-method ...
+   :public object method-definiton-method ...
+ }
+
+

Resolvers

The Next Scripting Framework defines Tcl resolvers for method and @@ -794,7 +895,7 @@ -

Exit handlers

+

Exit Handlers

The exit hander interface changed from a method of ::xotcl::Object into three Tcl procs in the ::nx::core @@ -808,6 +909,6 @@


- Last modified: Fri Jul 30 13:56:13 CEST 2010 + Last modified: Sun Aug 1 17:40:20 CEST 2010