Index: doc/next-migration.html =================================================================== diff -u -rf41ae7e802868efee95b5d5682edfdbbe9ba2f64 -rf25391601dc81bb54fe227aa5e9341d17de30ae9 --- doc/next-migration.html (.../next-migration.html) (revision f41ae7e802868efee95b5d5682edfdbbe9ba2f64) +++ doc/next-migration.html (.../next-migration.html) (revision f25391601dc81bb54fe227aa5e9341d17de30ae9) @@ -1079,14 +1079,14 @@ # Stack of Things # - :variable things "" + :variable things "" - :public method push {thing} { + :public method push {thing} { set :things [linsert ${:things} 0 $thing] return $thing } - :public method pop {} { + :public method pop {} { set top [lindex ${:things} 0] set :things [lrange ${:things} 1 end] return $top @@ -1176,17 +1176,17 @@
   namespace eval mypackage {
 
-      package require XOTcl 2.0
+      package require XOTcl 2.0
 
      # Define a class using XOTcl
       xotcl::Class C1
       C1 instproc foo {} {puts "hello world"}
 
-      package require nx
+      package require nx
 
      # Define a class using NX
       nx::Class create C2 {
-         :public method foo {} {puts "hello world"}
+         :public method foo {} {puts "hello world"}
       }
    }

One could certainly create object or classes from the different object @@ -1361,8 +1361,8 @@ # in the init-block of a class Class create C { - :method foo args {...} - :class method bar args {...} + :method foo args {...} + :class method bar args {...} }

Class create C {
-  :method foo args {...}
-  :method bar args {
+  :method foo args {...}
+  :method bar args {
      :foo 1 2 3 ;# invoke own method
      o baz      ;# invoke other objects method
   }
 }
 Object create o {
-  :public method baz {} {...}
+  :public method baz {} {...}
 }
@@ -2053,7 +2053,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
Class create C {
-  :method foo args {...}
+  :method foo args {...}
     # Method scoped variable a
     set a 1
     # Instance variable b
@@ -2495,8 +2495,8 @@
 # initialization of the object.
 
 Class create Foo {
-  :variable x 1
-  :variable y 2
+  :variable x 1
+  :variable y 2
 }
 
 # Create instance of the class Foo
@@ -2562,8 +2562,8 @@
 # similar to "class method".
 
 Class create Foo {
-  :class variable V 100
-  :variable x 1
+  :class variable V 100
+  :variable x 1
 }
@@ -2731,8 +2731,8 @@ # scripted configuration; see below) Class create Foo { - :property a - :property {b 1} + :property a + :property {b 1} } # Create instance of the class Foo and @@ -2775,13 +2775,13 @@ # property Class create C { - :property x - :property {y 1} - :class property cp + :property x + :property {y 1} + :class property cp } Object create o { - :property op + :property op } @@ -2803,7 +2803,7 @@ Class Person -slots { Attribute create sex -type "sex" { my proc type=sex {name value} { - switch -glob $value { + switch -glob $value { m* {return m} f* {return f} default { @@ -2829,10 +2829,10 @@ # property specific type checker Class create Person { - :property sex { + :property sex { :type "sex" - :method type=sex {name value} { - switch -glob $value { + :method type=sex {name value} { + switch -glob $value { m* {return m} f* {return f} default { @@ -2924,8 +2924,8 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
Class create Foo {
-   :property a:boolean
-   :property {b:integer 1}
+   :property a:boolean
+   :property {b:integer 1}
 }
@@ -2997,8 +2997,8 @@
 Class create Foo {
-   :property a:required
-   :property b:boolean,required
+   :property a:required
+   :property b:boolean,required
 }
@@ -3069,9 +3069,9 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
Class create Foo {
-  :property {ints:integer,0..n ""}
-  :property objs:object,1..n
-  :property obj:object,0..1
+  :property {ints:integer,0..n ""}
+  :property objs:object,1..n
+  :property obj:object,0..1
 }
@@ -3145,10 +3145,10 @@ # parameter (a and b) Class create C { - :public method foo {-x:integer -y:required -z a b} { + :public method foo {-x:integer -y:required -z a b} { # ... } - :create c1 + :create c1 } # invoke method foo c1 foo -x 1 -y a 2 3 @@ -3186,22 +3186,22 @@ Class create C { # trailing (or interleaved) non-positional # parameters - :public method m1 {a b -x:integer -y} { + :public method m1 {a b -x:integer -y} { # ... } # positional parameters with value constraints - :public method m2 {a:integer b:boolean} { + :public method m2 {a:integer b:boolean} { #... } # optional positional parameter (trailing) - :public method set {varName value:optional} { + :public method set {varName value:optional} { # .... } # parameter with multiplicity - :public method m3 {-objs:object,1..n c:class,0..1} { + :public method m3 {-objs:object,1..n c:class,0..1} { # ... } @@ -3272,24 +3272,24 @@ # Define method foo which returns an # integer value - :method foo -returns integer {-x:integer} { + :method foo -returns integer {-x:integer} { # ... } # Define an alias for the Tcl command ::incr # and assure, it always returns an integer # value - :alias incr -returns integer ::incr + :alias incr -returns integer ::incr # Define a forwarder that has to return an # integer value - :forward ++ -returns integer ::expr 1 + + :forward ++ -returns integer ::expr 1 + # Define a method that has to return a # non-empty list of objects - :public class method instances {} \ + :public class method instances {} \ -returns object,1..n { - return [:info instances] + return [:info instances] } } @@ -4325,7 +4325,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
# List only application specific methods
-/obj/ info lookup methods -source application ... ?pattern?
+/obj/ info lookup methods -source application ... ?pattern?
 # Returns list of method names
@@ -4391,7 +4391,7 @@ # -source might be all|application|baseclasses # -type is the class of the slot object -/obj/ info lookup slots ?-type ...? ?-source ... ?pattern? +/obj/ info lookup slots ?-type ...? ?-source ... ?pattern? # Returns list of slot objects @@ -5001,7 +5001,7 @@ /obj/ info slot objects ?-type ...? ?pattern? /cls/ class info slot objects ?-type ...? ?pattern? /cls/ info slot objects \ - ?-type value? ?-closure? ?-source value? ?pattern? + ?-type value? ?-closure? ?-source value? ?pattern?
@@ -5030,11 +5030,11 @@
# List definition of slots
 
 /obj/ info slot definition \
-   ?-type value? ?-closure? ?-source value? ?pattern?
+   ?-type value? ?-closure? ?-source value? ?pattern?
 /cls/ class info slot definition \
-   ?-type value? ?-closure? ?-source value? ?pattern?
+   ?-type value? ?-closure? ?-source value? ?pattern?
 /cls/ info slot definition \
-   ?-type value? ?-closure? ?-source value? ?pattern?
+ ?-type value? ?-closure? ?-source value? ?pattern?
@@ -5048,6 +5048,35 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} +
/cls/ info parameter
+
+
+
# "info properties" is a short form of "info slot definiton"
+
+/cls/ info properties \
+   ?-type value? ?-closure? ?-source value? ?pattern?
+ + +
+
# n.a.
-
/obj/ info method handle /methodName/
-/cls/ ?class? info method handle /methodName/
+
#
+# List the method handle of the specified method,
+# can be used e.g. for aliases. "handle" is the short
+# form of "definitionhandle".
+#
+/obj/ info method handle /methodName/
+/cls/ ?class? info method handle /methodName/
+#
+# For ensemble methods (method name contains
+# spaces) one can query as well the registration
+# handle, which is the handle to the root of the
+# ensemble; the definiton handle points to the
+# leaf of the ensemble.
+#
+/obj/ info method registrationhandle /methodName/
+/cls/ ?class? info method registrationhandle /methodName/
+#
+# For aliases, one can query the original definition
+# via "info method origin"
+#
+/obj/ info method origin /methodName/
+/cls/ ?class? info method origin /methodName/
@@ -5936,7 +5985,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info is metaclass
+
/obj/ info is metaclass
@@ -6411,7 +6460,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ require namespace
+
/obj/ require namespace
@@ -6437,7 +6486,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ require method
+
/obj/ require method
@@ -6490,7 +6539,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /obj/ check /checkptions/
+
::nsf::method::assertion /obj/ check /checkptions/
@@ -6516,7 +6565,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /obj/ check
+
::nsf::method::assertion /obj/ check
@@ -6542,7 +6591,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /obj/ object-invar /conditions/
+
::nsf::method::assertion /obj/ object-invar /conditions/
@@ -6568,7 +6617,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /obj/ object-invar
+
::nsf::method::assertion /obj/ object-invar
@@ -6594,7 +6643,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /cls/ class-invar /conditions/
+
::nsf::method::assertion /cls/ class-invar /conditions/
@@ -6620,7 +6669,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /cls/ class-invar
+
::nsf::method::assertion /cls/ class-invar
@@ -6646,7 +6695,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /cls/ object-invar /conditions/
+
::nsf::method::assertion /cls/ object-invar /conditions/
@@ -6672,7 +6721,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
::nsf::method::assertion /cls/ object-invar
+
::nsf::method::assertion /cls/ object-invar
@@ -6747,7 +6796,7 @@
# XOTcl example
 
 Class Foo -parameter {{x 1}}
-Class Bar -superclass Foo -parameter x
+Class Bar -superclass Foo -parameter x
 Bar b1
@@ -6771,10 +6820,10 @@ nx::Class create Foo Foo create f1 # now alter the class of object f1 -f1 configure -class nx::Object +f1 configure -class nx::Object # alternate approach via Next Scripting Framework -::nsf::relation f1 class ::nx::Object
+::nsf::relation f1 class ::nx::Object

3.2.4. Info heritage

@@ -6856,7 +6905,7 @@