Index: TODO =================================================================== diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -rf25391601dc81bb54fe227aa5e9341d17de30ae9 --- TODO (.../TODO) (revision c4997e0189bb712287aa53d12bb3e332acfb781d) +++ TODO (.../TODO) (revision f25391601dc81bb54fe227aa5e9341d17de30ae9) @@ -3710,21 +3710,20 @@ "info method registrationhandle /methodName/" - rename "info method origin /methodName/" into "info method definitionhandle /methodName/" + +- added "info method handle" as short form of "info method definitionhandle" - added "info method origin" to return the target of an alias (or empty) +- update migration guide and tutorial +======================================================================== TODO: - warnings for "numeric" names for args and nonpos-args? - special handling of values looking like nonpos-flags, but wich are not ones (-1, "- a b c", ....) in detection when to throw unknow. - - private: - * document private in tutorial - - - add "property" and "attribute" and "info property" and "info slot ..." to migration guide - - naming of slot classes * should we switch from "-class" to "-slotclass"? 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 @@ Index: doc/next-migration.txt =================================================================== diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -rf25391601dc81bb54fe227aa5e9341d17de30ae9 --- doc/next-migration.txt (.../next-migration.txt) (revision c4997e0189bb712287aa53d12bb3e332acfb781d) +++ doc/next-migration.txt (.../next-migration.txt) (revision f25391601dc81bb54fe227aa5e9341d17de30ae9) @@ -2229,6 +2229,17 @@ ---------------- |[source,tcl] ---------------- +/cls/ info parameter +---------------- +|[source,tcl] +---------------- +# "info properties" is a short form of "info slot definiton" + +/cls/ info properties \ + ?-type value? ?-closure? ?-source value? ?pattern? +---------------- +|[source,tcl] +---------------- # n.a. ---------------- |[source,tcl] @@ -2461,8 +2472,28 @@ ---------------- |[source,tcl] ---------------- +# +# 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/ ---------------- |====================== Index: doc/next-tutorial.html =================================================================== diff -u -rf41ae7e802868efee95b5d5682edfdbbe9ba2f64 -rf25391601dc81bb54fe227aa5e9341d17de30ae9 --- doc/next-tutorial.html (.../next-tutorial.html) (revision f41ae7e802868efee95b5d5682edfdbbe9ba2f64) +++ doc/next-tutorial.html (.../next-tutorial.html) (revision f25391601dc81bb54fe227aa5e9341d17de30ae9) @@ -734,7 +734,7 @@

The Next Scripting Language (NX) is a highly flexible, Tcl [Ousterhout 1990] based object oriented scripting language. It is a successor of XOTcl 1 [Neumann and Zdun 2000a] and is based on 10 -years of experience with XOTcl in projects containing several hundert +years of experience with XOTcl in projects containing several hundred thousand lines of code. While XOTcl was the first language designed to provide language support for design patterns, the focus of the Next Scripting Framework and NX are on combining this with Language @@ -857,14 +857,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 @@ -945,7 +945,7 @@ 17 18

#!/bin/env tclsh
-package require nx
+package require nx
 
 nx::Class create Stack {
 
@@ -1042,14 +1042,14 @@
  15
 
nx::Object create stack {
 
-   :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
@@ -1162,14 +1162,14 @@
   # the methods of class Stack.
   #
 
-  :variable count 0
+  :variable count 0
 
-  :public method push {thing} {
+  :public method push {thing} {
     incr :count
     next
   }
 
-  :public method pop {} {
+  :public method pop {} {
     if {${:count} == 0} then { error "Stack empty!" }
     incr :count -1
     next
@@ -1221,15 +1221,15 @@
  20
  21
  22
-
% package require nx
+
% package require nx
 2.0
 % source Stack.tcl
 ::Stack
 % source Safety.tcl
 ::Safety
 % Stack create s1
 ::s1
-% Stack create s2 -mixin Safety
+% Stack create s2 -mixin Safety
 ::s2
 % s2 push a
 a
@@ -1239,10 +1239,10 @@
 Stack empty!
 
 % s1 info precedence
-::Stack ::nx::Object
+::Stack ::nx::Object
 
 % s2 info precedence
-::Safety ::Stack ::nx::Object
+::Safety ::Stack ::nx::Object

When the method push of s2 is called, first the method of the mixin class Safety will be invoked that increments the counter and continues with next to call the shadowed method, here the method @@ -1295,7 +1295,7 @@ # Create a safe stack class by using Stack and mixin # Safety # -Class create SafeStack -superclass Stack -mixin Safety +Class create SafeStack -superclass Stack -mixin Safety SafeStack create s3

The difference to the case with the per-object mixin is that now, @@ -1353,7 +1353,7 @@ # to check the type of entries # - :public method push {thing:integer} { + :public method push {thing:integer} { next } }

@@ -1392,13 +1392,13 @@ 8 9 10 -
nx::Class create IntegerStack -superclass Stack {
+
nx::Class create IntegerStack -superclass Stack {
 
   #
   # Create a Stack accepting only integers
   #
 
-  :public method push {thing:integer} {
+  :public method push {thing:integer} {
     next
   }
 }
@@ -1463,18 +1463,18 @@ 24
nx::Class create Stack2 {
 
-   :public class method available_stacks {} {
-      return [llength [:info instances]]
+   :public class method available_stacks {} {
+      return [llength [:info instances]]
    }
 
-   :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
@@ -1568,7 +1568,7 @@
  11
 
Class create Foo {
 
-  :method foo args {...}
+  :method foo args {...}
     # "a" is a method scoped variable
     set a 1
     # "b" is an Instance variable
@@ -1650,17 +1650,17 @@
 # and "birthday"
 #
 nx::Class create Person {
-  :property name:required
-  :property birthday
+  :property name:required
+  :property birthday
 }
 
 #
 # Define a class Student as specialization of Person
 # with additional properties
 #
-nx::Class create Student -superclass Person {
-  :property matnr:required
-  :property {oncampus:boolean true}
+nx::Class create Student -superclass Person {
+  :property matnr:required
+  :property {oncampus:boolean true}
 }
 
 #
@@ -1733,12 +1733,12 @@
  14
  15
 
Class create Base {
-  :variable x 1
+  :variable x 1
   # ...
 }
 
-Class create Derived -superclass Base {
-  :variable y 2
+Class create Derived -superclass Base {
+  :variable y 2
   # ...
 }
 
@@ -1784,15 +1784,15 @@
  19
 
Class create Base2 {
  # ...
- :method init {} {
+ :method init {} {
    set :x 1
    # ....
  }
 }
 
-Class create Derived2 -superclass Base2 {
+Class create Derived2 -superclass Base2 {
  # ...
- :method init {} {
+ :method init {} {
    set :y 2
    next
    # ....
@@ -1860,7 +1860,7 @@
 nx::Class create Dog {
 
   # Define a scripted method for the class
-  :public method bark {} {
+  :public method bark {} {
     puts "[self] Bark, bark, bark."
   }
 }
@@ -1938,13 +1938,13 @@
  24
  25
 
nx::Class create Dog {
- :public method bark {} { puts "[self] Bark, bark, bark." }
- :method init {} { Tail create [self]::tail}
+ :public method bark {} { puts "[self] Bark, bark, bark." }
+ :method init {} { Tail create [self]::tail}
 }
 
 nx::Class create Tail {
-  :property {length:double 5}
-  :public method wag {} {return Joy}
+  :property {length:double 5}
+  :public method wag {} {return Joy}
 }
 
 # Create an instance of the class
@@ -2000,16 +2000,16 @@
  18
  19
 
nx::Class create Dog {
-  :public method bark {} { puts "[self] Bark, bark, bark." }
-  :method init {} {
+  :public method bark {} { puts "[self] Bark, bark, bark." }
+  :method init {} {
     Tail create [self]::tail
-    :public forward wag [self]::tail wag
+    :public forward wag [self]::tail wag
   }
 }
 
 nx::Class create Tail {
-  :property {length 5}
-  :public method wag {} {return Joy}
+  :property {length 5}
+  :public method wag {} {return Joy}
 }
 
 # Create an instance of the class
@@ -2077,10 +2077,10 @@
  12
  13
 
nx::Class create Dog {
-  :public method bark {} { puts "[self] Bark, bark, bark." }
+  :public method bark {} { puts "[self] Bark, bark, bark." }
 
   # Define a public alias for the method "bark"
-  :public alias warn [:info method handle bark]
+  :public alias warn [:info method handle bark]
   # ...
 }
 
@@ -2161,13 +2161,13 @@
 
nx::Class create Foo {
 
   # Define a public method
-  :public method foo {} {
+  :public method foo {} {
     # ....
     return [:helper]
   }
 
   # Define a protected method
-  :method helper {} {
+  :method helper {} {
      return 1
   }
 }
@@ -2214,14 +2214,14 @@
  13
  14
 
nx::Class create Base {
-  :private method helper {a b} {expr {$a + $b}}
-  :public method foo     {a b} {: -local helper $a $b}
+  :private method helper {a b} {expr {$a + $b}}
+  :public method foo     {a b} {: -local helper $a $b}
 }
 
-nx::Class create Sub -superclass Base {
-  :public method bar     {a b} {: -local helper $a $b}
-  :private method helper {a b} {expr {$a * $b}}
-  :create s1
+nx::Class create Sub -superclass Base {
+  :public method bar     {a b} {: -local helper $a $b}
+  :private method helper {a b} {expr {$a * $b}}
+  :create s1
 }
 
 s1 foo 3 4     ;# returns 7
@@ -2280,8 +2280,8 @@
   7
   8
 
nx::Class create C {
-  :public method foo {} {return 1}
-  :create c1
+  :public method foo {} {return 1}
+  :create c1
 }
 
 # Method "foo" is defined on class "C"
@@ -2336,10 +2336,10 @@
  18
  19
 
nx::Class create C {
-  :public method foo {} {return 1}
-  :create c1 {
-     :public method foo {} {return 2}
-     :public method bar {} {return 3}
+  :public method foo {} {return 1}
+  :create c1 {
+     :public method foo {} {return 2}
+     :public method bar {} {return 3}
   }
 }
 
@@ -2351,7 +2351,7 @@
 
 # Method "baz" is an object specific method of "o1"
 nx::Object create o1 {
-  :public method baz {} {return 4}
+  :public method baz {} {return 4}
 }
 o1 baz
@@ -2413,13 +2413,13 @@ # Define a class method "bar" and an instance # method "foo" # - :public class method bar {} {return 2} - :public method foo {} {return 1} + :public class method bar {} {return 2} + :public method foo {} {return 1} # # Create an instance of the current class # - :create c1 + :create c1 } # Method "bar" is a class method of class "C" @@ -2487,11 +2487,11 @@ # Define an ensemble method "string" with sub-methods # "length", "tolower" and "info" - :public method "string length" {x} {....} - :public method "string tolower" {x} {...} - :public method "string info" {x} {...} + :public method "string length" {x} {....} + :public method "string tolower" {x} {...} + :public method "string info" {x} {...} ... - :create c1 + :create c1 } # Invoke the ensemble method @@ -2540,15 +2540,15 @@ 19 20
nx::Class create C {
-  :public method foo {} { return "C foo: [next]"}
+  :public method foo {} { return "C foo: [next]"}
 }
 
-nx::Class create D -superclass C {
+nx::Class create D -superclass C {
 
-  :public method foo {} { return "D foo: [next]"}
+  :public method foo {} { return "D foo: [next]"}
 
-   :create d1 {
-     :public method foo {} { return "d1 foo: [next]"}
+   :create d1 {
+     :public method foo {} { return "d1 foo: [next]"}
    }
 }
 
@@ -2610,10 +2610,10 @@
  23
  24
 
nx::Class create M1 {
-  :public method foo {} { return "M1 foo: [next]"}
+  :public method foo {} { return "M1 foo: [next]"}
 }
 nx::Class create M2 {
-  :public method foo {} { return "M2 foo: [next]"}
+  :public method foo {} { return "M2 foo: [next]"}
 }
 
 #
@@ -2695,7 +2695,7 @@
 current method is defined as a per-object method, foo is resolved as
 a per-object method. The effect is that the mixin definitions are
 ignored. The invocation flag -local was already introduced int the
-setction about method protection, where it was used to call private
+section about method protection, where it was used to call private
 methods.

The invocation flag -intrinsic means that the method has to be resolved from the intrinsic definitions, meaning simply without mixins. The @@ -2816,22 +2816,22 @@ # # Method foo has positional parameters: # - :public method foo {x y} { + :public method foo {x y} { puts "x=$x y=$y" } # # Method bar has non-positional parameters: # - :public method bar {-x -y} { + :public method bar {-x -y} { puts "x=$x y=$y" } # # Method baz has non-positional and # positional parameters: # - :public method baz {-x -y a} { + :public method baz {-x -y a} { puts "x? [info exists x] y? [info exists y] a=$a" } } @@ -2919,15 +2919,15 @@ # Method foo has one required and one optional # positional parameter: # - :public method foo {x:required y:optional} { + :public method foo {x:required y:optional} { puts "x=$x y? [info exists y]" } # # Method bar has one required and one optional # non-positional parameter: # - :public method bar {-x:required -y:optional} { + :public method bar {-x:required -y:optional} { puts "x=$x y? [info exists y]" } } @@ -2996,14 +2996,14 @@ # # Positional parameter with default value: # - :public method foo {x:required {y 101}} { + :public method foo {x:required {y 101}} { puts "x=$x y? [info exists y]" } # # Non-positional parameter with default value: # - :public method bar {{-x 10} {-y 20}} { + :public method bar {{-x 10} {-y 20}} { puts "x=$x y? [info exists y]" } } @@ -3085,14 +3085,14 @@ # # Positional parameter with value constraints: # - :public method foo {x:integer o:object,optional} { + :public method foo {x:integer o:object,optional} { puts "x=$x o? [info exists o]" } # # Non-positional parameter with value constraints: # - :public method bar {{-x:integer 10} {-verbose:boolean false}} { + :public method bar {{-x:integer 10} {-verbose:boolean false}} { puts "x=$x y=$y" } } @@ -3158,7 +3158,7 @@ # # Parameterized value constraints # - :public method work { + :public method work { -person:object,type=Person -project:object,type=Project } { @@ -3272,10 +3272,10 @@ # using the new value checkers # Class create D { - :public method foo {a:groupsize} { + :public method foo {a:groupsize} { # ... } - :public method bar {a:choice,arg=red|yellow|green b:choice,arg=good|bad} { + :public method bar {a:choice,arg=red|yellow|green b:choice,arg=good|bad} { # ... } } @@ -3378,23 +3378,23 @@ # Positional parameter with an possibly empty # single value # - :public method foo {x:integer,0..1} { + :public method foo {x:integer,0..1} { puts "x=$x" } # # Positional parameter with an possibly empty # list of values value # - :public method bar {x:integer,0..n} { + :public method bar {x:integer,0..n} { puts "x=$x" } # # Positional parameter with a non-empty # list of values # - :public method baz {x:integer,1..n} { + :public method baz {x:integer,1..n} { puts "x=$x" } }

@@ -3519,17 +3519,17 @@
# and "birthday" # nx::Class create Person { - :property name:required - :property birthday + :property name:required + :property birthday } # # Define a class Student as specialization of Person # with and additional property # -nx::Class create Student -superclass Person { - :property matnr:required - :property {oncampus:boolean true} +
nx::Class create Student -superclass Person { + :property matnr:required + :property {oncampus:boolean true} } # @@ -3607,12 +3607,12 @@ 8
Object parameter for Person p1:
    -name:required -birthday ...
-   -mixin:mixinreg,alias,1..n -filter:filterreg,alias,1..n _:initcmd,optional
+   -mixin:mixinreg,alias,1..n -filter:filterreg,alias,1..n _:initcmd,optional
 
 Object parameter for Student s1:
    -matnr:required {-oncampus:boolean true}
    -name:required -birthday ...
-   -mixin:mixinreg,alias,1..n -filter:filterreg,alias,1..n _:initcmd,optional
+ -mixin:mixinreg,alias,1..n -filter:filterreg,alias,1..n _:initcmd,optional

The actual values can be optained via introspection via Person info parameter definition. The object parameter types mixinreg and filterreg are for converting definitions of filters and mixins. The @@ -3663,8 +3663,8 @@ 2 3

Object parameter for Class Student:
-   -mixin:mixinreg,alias,1..n -filter:filterreg,alias,1..n ...
-   {-superclass:class,alias,1..n ::nx::Object} ...
+ -mixin:mixinreg,alias,1..n -filter:filterreg,alias,1..n ... + {-superclass:class,alias,1..n ::nx::Object} ...

The actual values can be obtained via introspection via nx::Class info parameter definition.

@@ -3775,8 +3775,8 @@ 8 9 10 -
::nx::Object create o {
-  :method unknown {called_method args} {
+
::nx::Object create o {
+  :method unknown {called_method args} {
     puts "Unknown method '$called_method' called"
   }
 }
@@ -3831,24 +3831,24 @@
  20
  21
  22
-
::nx::Class public class method __unknown {name} {
+
::nx::Class public class method __unknown {name} {
   # A very simple unknown handler, showing just how
   # the mechanism works.
   puts "***** __unknown called with <$name>"
-  ::nx::Class create $name
+  ::nx::Class create $name
 }
 
 # Register an unknown handler as a method of ::nx::Class
-::nsf::object::unknown::add nx {::nx::Class __unknown}
+::nsf::object::unknown::add nx {::nx::Class __unknown}
 
-::nx::Object create o {
+::nx::Object create o {
   # The class M is unknown at this point
 
-  :mixin add M
+  :mixin add M
   # The line above has triggered the unknown class handler,
   # class M is now defined
 
-  puts [:info mixin classes]
+  puts [:info mixin classes]
   # The output will be:
   #     ***** __unknown called with <::M>
   #     ::M
@@ -3959,7 +3959,7 @@
 
 
Index: doc/next-tutorial.txt
===================================================================
diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -rf25391601dc81bb54fe227aa5e9341d17de30ae9
--- doc/next-tutorial.txt	(.../next-tutorial.txt)	(revision c4997e0189bb712287aa53d12bb3e332acfb781d)
+++ doc/next-tutorial.txt	(.../next-tutorial.txt)	(revision f25391601dc81bb54fe227aa5e9341d17de30ae9)
@@ -999,7 +999,7 @@
   :public method bark {} { puts "[self] Bark, bark, bark." }
 
   # Define a public alias for the method "bark"
-  :public alias warn [:info method registrationhandle bark]
+  :public alias warn [:info method handle bark]
   # ...
 }
 
Index: generic/nsf.c
===================================================================
diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -rf25391601dc81bb54fe227aa5e9341d17de30ae9
--- generic/nsf.c	(.../nsf.c)	(revision c4997e0189bb712287aa53d12bb3e332acfb781d)
+++ generic/nsf.c	(.../nsf.c)	(revision f25391601dc81bb54fe227aa5e9341d17de30ae9)
@@ -22004,7 +22004,7 @@
 
 /*
 objectInfoMethod method NsfObjInfoMethodMethod {
-  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}
+  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}
   {-argName "name" -required 1 -type tclobj}
 }
 */
@@ -22020,6 +22020,9 @@
   Tcl_DStringInit(dsPtr);
   cmd = ResolveMethodName(interp, object->nsPtr, methodNameObj,
 			  dsPtr, ®Object, &defObject, &methodName1, &fromClassNS);
+  if (subcmd == InfomethodsubcmdHandleIdx) {
+    subcmd = InfomethodsubcmdDefinitionhandleIdx;
+  }
   /*fprintf(stderr,
 	  "NsfObjInfoMethodMethod method %s / %s object %p regObject %p defObject %p fromClass %d\n",
 	  ObjStr(methodNameObj), methodName1, object, regObject, defObject, fromClassNS);*/
@@ -22300,7 +22303,7 @@
 
 /*
 classInfoMethod method NsfClassInfoMethodMethod {
-  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}
+  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|origin|handle|parameter|parametersyntax|type|precondition|postcondition|submethods"}
   {-argName "name" -required 1 -type tclobj}
 }
 */
@@ -22316,6 +22319,9 @@
   Tcl_DStringInit(dsPtr);
   cmd = ResolveMethodName(interp, class->nsPtr, methodNameObj,
 			  dsPtr, ®Object, &defObject, &methodName1, &fromClassNS);
+  if (subcmd == InfomethodsubcmdHandleIdx) {
+    subcmd = InfomethodsubcmdDefinitionhandleIdx;
+  }
   /*fprintf(stderr,
 	  "NsfClassInfoMethodMethod object %p regObject %p defObject %p %s fromClass %d cmd %p method %s\n",
 	  &class->object, regObject, defObject, ObjectName(defObject), fromClassNS, cmd, methodName1);*/
Index: generic/nsfAPI.decls
===================================================================
diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -rf25391601dc81bb54fe227aa5e9341d17de30ae9
--- generic/nsfAPI.decls	(.../nsfAPI.decls)	(revision c4997e0189bb712287aa53d12bb3e332acfb781d)
+++ generic/nsfAPI.decls	(.../nsfAPI.decls)	(revision f25391601dc81bb54fe227aa5e9341d17de30ae9)
@@ -362,7 +362,7 @@
   {-argName "pattern" -required 0}
 }
 objectInfoMethod method NsfObjInfoMethodMethod {
-  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}
+  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}
   {-argName "name" -required 1 -type tclobj}
 }
 objectInfoMethod methods NsfObjInfoMethodsMethod {
@@ -417,7 +417,7 @@
 }
 
 classInfoMethod method NsfClassInfoMethodMethod {
-  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}
+  {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}
   {-argName "name" -required 1 -type tclobj}
 }
 classInfoMethod methods NsfClassInfoMethodsMethod {
Index: generic/nsfAPI.h
===================================================================
diff -u -rc4997e0189bb712287aa53d12bb3e332acfb781d -rf25391601dc81bb54fe227aa5e9341d17de30ae9
--- generic/nsfAPI.h	(.../nsfAPI.h)	(revision c4997e0189bb712287aa53d12bb3e332acfb781d)
+++ generic/nsfAPI.h	(.../nsfAPI.h)	(revision f25391601dc81bb54fe227aa5e9341d17de30ae9)
@@ -1,10 +1,10 @@
 
-enum InfomethodsubcmdIdx {InfomethodsubcmdNULL, InfomethodsubcmdArgsIdx, InfomethodsubcmdBodyIdx, InfomethodsubcmdDefinitionIdx, InfomethodsubcmdExistsIdx, InfomethodsubcmdRegistrationhandleIdx, InfomethodsubcmdDefinitionhandleIdx, InfomethodsubcmdOriginIdx, InfomethodsubcmdParameterIdx, InfomethodsubcmdParametersyntaxIdx, InfomethodsubcmdTypeIdx, InfomethodsubcmdPreconditionIdx, InfomethodsubcmdPostconditionIdx, InfomethodsubcmdSubmethodsIdx};
+enum InfomethodsubcmdIdx {InfomethodsubcmdNULL, InfomethodsubcmdArgsIdx, InfomethodsubcmdBodyIdx, InfomethodsubcmdDefinitionIdx, InfomethodsubcmdExistsIdx, InfomethodsubcmdRegistrationhandleIdx, InfomethodsubcmdDefinitionhandleIdx, InfomethodsubcmdHandleIdx, InfomethodsubcmdOriginIdx, InfomethodsubcmdParameterIdx, InfomethodsubcmdParametersyntaxIdx, InfomethodsubcmdTypeIdx, InfomethodsubcmdPreconditionIdx, InfomethodsubcmdPostconditionIdx, InfomethodsubcmdSubmethodsIdx};
 
 static int ConvertToInfomethodsubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, 
 			    ClientData *clientData, Tcl_Obj **outObjPtr) {
   int index, result;
-  static CONST char *opts[] = {"args", "body", "definition", "exists", "registrationhandle", "definitionhandle", "origin", "parameter", "parametersyntax", "type", "precondition", "postcondition", "submethods", NULL};
+  static CONST char *opts[] = {"args", "body", "definition", "exists", "registrationhandle", "definitionhandle", "handle", "origin", "parameter", "parametersyntax", "type", "precondition", "postcondition", "submethods", NULL};
   (void)pPtr;
   result = Tcl_GetIndexFromObj(interp, objPtr, opts, "infomethodsubcmd", 0, &index);
   *clientData = (ClientData) INT2PTR(index + 1);
@@ -185,7 +185,7 @@
 static enumeratorConverterEntry enumeratorConverterEntries[] = {
   {ConvertToScope, "all|class|object"},
   {ConvertToInfoobjectparametersubcmd, "list|name|parameter|parametersyntax"},
-  {ConvertToInfomethodsubcmd, "args|body|definition|exists|registrationhandle|definitionhandle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"},
+  {ConvertToInfomethodsubcmd, "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"},
   {ConvertToCallprotection, "all|public|protected|private"},
   {ConvertToMethodtype, "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"},
   {ConvertToFrame, "method|object|default"},