... method ... { - set /newVar/ ${/:otherVar/} + set /newVar/ ${:/otherVar/} }
Index: doc/next-migration.html =================================================================== diff -u -rd79efb10b92ad2045196990af50bc042e60b88f4 -r56f48a605e58baed9ed8d0f4d43cd704bf34811d --- doc/next-migration.html (.../next-migration.html) (revision d79efb10b92ad2045196990af50bc042e60b88f4) +++ doc/next-migration.html (.../next-migration.html) (revision 56f48a605e58baed9ed8d0f4d43cd704bf34811d) @@ -821,7 +821,7 @@ instance variables). The encapsulation of NX is stronger than in XOTcl but still weak compared to languages like C++; a developer can still access other objects' variables via some idioms, but NX makes - accesses to other objects variables explicit. The requiredness to + accesses to other objects' variables explicit. The requiredness to make these accesses explicit should encourage developer to implement well defined interfaces to provide access to instance variables.
@@ -1959,7 +1959,7 @@ C instproc foo args {...} C instproc bar args { my foo 1 2 3 ;# invoke own method - o baz ;# invoke other objects method + o baz ;# invoke other object's method } Object o o proc baz {} {...} @@ -1978,7 +1978,7 @@ :method foo args {...} :method bar args { :foo 1 2 3 ;# invoke own method - o baz ;# invoke other objects method + o baz ;# invoke other object's method } } Object create o { @@ -2112,7 +2112,7 @@ # resolver (preferred and fastest way) ... method ... { - set /:newVar/ ?value? + set :/newVar/ ?value? }# Read own instance variable ... method ... { - set /varName/ [set /:otherVar/] + set /varName/ [set :/otherVar/] }
... method ... { - set /newVar/ ${/:otherVar/} + set /newVar/ ${:/otherVar/} }
# Test existence of own instance variable ... method ... { - info /:varName/ + info :/varName/ }
/cls/ info methods -type alias ?pattern?
/cls/ info methods -type alias ?pattern? +/cls/ info methods -type forwarder ?pattern? +/cls/ info methods -type object ?pattern? +/cls/ info methods -callprotection public|protected ...
# n.a.
/cls/ info methods -type forwarder ?pattern?
# n.a.
/cls/ info methods -type object ?pattern?
# n.a.
/cls/ info methods -callprotection public|protected ...
/obj/ info object methods -type alias ?pattern?+
/obj/ info object methods -type alias ?pattern? +/obj/ info object methods -type forwarder ?pattern? +/obj/ info object methods -type object ?pattern? +/obj/ info object methods -callprotection public|protected ...-
# n.a.
/obj/ info object methods -type forwarder ?pattern?
# n.a.
/obj/ info object methods -type object ?pattern?
# n.a.
/obj/ info object methods -callprotection public|protected ...
/obj/ info object method exists /methodName/ -/obj/ info object methods /methodName/ -/cls/ info method exists /methodName/ -/cls/ info methods /methodName/+
/cls/ info method exists /methodName/ +/cls/ info methods /methodName/ +/obj/ info object method exists /methodName/ +/obj/ info object methods /methodName/@@ -4433,7 +4283,7 @@
XOTcl contains a long list of info
subcommands for different kinds of
methods and for obtaining more detailed information about these
methods.
Another powerful introspection option in NX is info method
-parametersyntax
which obtains a representation of the parameters of a
-method in the style of Tcl man pages (regardless of the kind of
-method).
While XOTcl uses different names for info options for objects and
+classes (using the prefix "inst" for instance specific method), NX
+uses for object specific method the modifier object
. For definition
+of class object specific methods, use the modifier object
as usual.
@@ -4498,7 +4349,8 @@
.nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
.nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
- /cls/ info instbody /methodName/ |
+
- /cls/ info method body /methodName/ |
+
@@ -4524,7 +4377,8 @@
.nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
.nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
- /cls/ info instargs /methodName/ |
+
- /cls/ info method args /methodName/ |
+
@@ -4550,7 +4405,8 @@
.nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
.nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
- /cls/ info instnonposargs /methodName/ |
+
- /cls/ info method parameter /methodName/ |
+
@@ -4576,7 +4433,8 @@
.nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
.nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
- /cls/ info instdefault /methodName/ |
+
- # not needed, part of "info method parameter" |
+
@@ -4602,7 +4461,8 @@
.nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
.nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
- /cls/ info instpre /methodName/ |
+
- /cls/ info method precondition /methodName/ |
+
@@ -4628,7 +4489,8 @@
.nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
.nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
- /cls/ info instpost /methodName/ |
+
- /cls/ info method postcondition /methodName/ |
+
-
- # n.a. |
-
-
- /cls/ info method parametersyntax /methodName/ |
-
While XOTcl uses different names for info options for objects and
-classes (using the prefix "inst" for instance specific method), NX
-uses for object specific method the modifier object
.
Another powerful introspection option in NX is info ?object? method
+syntax
which obtains a representation of the parameters of a
+method in the style of Tcl man pages (regardless of the kind of
+method).
-
- /obj/ info body /methodName/ |
-
-
- /obj/ info object method body /methodName/ |
-
-
- /obj/ info args /methodName/ |
-
-
- /obj/ info object method args /methodName/ |
-
-
- /obj/ info nonposargs /methodName/ |
-
-
- /obj/ info object method parameter /methodName/ |
-
-
- /obj/ info default /methodName/ |
-
-
- # not needed, part of "info ?object? method parameter" |
-
-
- /obj/ info pre /methodName/ |
-
-
- /obj/ info object method precondition /methodName/ |
-
-
- /obj/ info post /methodName/ |
-
-
- /obj/ info object method postcondition /methodName/ |
-
-
- # n.a. |
-
-
- /obj/ info object method parametersyntax /methodName/ |
-
For definition of class object specific methods, use the modifier
-object
as usual.
Obtain information, how newly created object can be configured. The configuration of objects is performed in many languages over arguments to the constructors. NX has - what we think - a superiour approach for @@ -4953,7 +4605,7 @@
# Return configure parameter(s), the parameters # provided by a class for its instances; these # parameters define, how objects of this -# class can be configured. a pattern can +# class can be configured. A pattern can # be used to filter the results. /cls/ info configure parameters ?pattern? @@ -4987,7 +4639,7 @@
-
- # n.a. |
-
-
- /obj/ info object method type /methodName/ |
-
NX provides a richer set of introspection options to obtain information, where mixins classes are mixed into.
Similar as noted before, NX uses rather a hierarchical approach of naming using multiple layers of subcommands).
Call-stack introspection is very similar in NX and XOTcl. NX uses for
subcommand the term current
instead of self
, since self
has a
strong connotation to the current object. The term proc
is renamed
@@ -6637,7 +6264,7 @@