Index: doc/next-migration.html =================================================================== diff -u -rd8b8fec1b9c4b2ab7c1cc36c156649109ca0807a -rd303212e06bfd89c57038a26ba54f9f86e941601 --- doc/next-migration.html (.../next-migration.html) (revision d8b8fec1b9c4b2ab7c1cc36c156649109ca0807a) +++ doc/next-migration.html (.../next-migration.html) (revision d303212e06bfd89c57038a26ba54f9f86e941601) @@ -858,7 +858,7 @@
  • -One can define in NX hierachical method names (similar to +One can define in NX hierarchical method names (similar to commands and subcommands, called method ensembles) in a convenient way to provide extensible, hierarchical naming of methods. @@ -1003,7 +1003,7 @@

    Much Smaller Interface: The Next Scripting Language has a much smaller interface (i.e. provides less predefined methods) than - XOTcl (see Table 1), although the expressability was increased in + XOTcl (see Table 1), although the expressiveness was increased in NX.

  • @@ -1103,21 +1103,21 @@
    Class create Stack {
     
    -   #
    -   # Stack of Things
    -   #
    +   #
    +   # Stack of Things
    +   #
     
        :variable things ""
     
        :public method push {thing} {
    -      set :things [linsert ${:things} 0 $thing]
    -      return $thing
    +      set :things [linsert ${:things} 0 $thing]
    +      return $thing
        }
     
        :public method pop {} {
    -      set top [lindex ${:things} 0]
    -      set :things [lrange ${:things} 1 end]
    -      return $top
    +      set top [lindex ${:things} 0]
    +      set :things [lrange ${:things} 1 end]
    +      return $top
        }
     }
    @@ -1131,9 +1131,9 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    #
    -# Stack of Things
    -#
    +
    #
    +# Stack of Things
    +#
     
     Class Stack
     
    @@ -1144,14 +1144,14 @@
     
     Stack instproc push {thing} {
        my instvar things
    -   set things [linsert $things 0 $thing]
    -   return $thing
    +   set things [linsert $things 0 $thing]
    +   return $thing
     }
     
     Stack instproc pop {} {
        my instvar things
    -   set top [lindex $things 0]
    -   set things [lrange $things 1 end]
    +   set top [lindex $things 0]
    +   set things [lrange $things 1 end]
     }
    @@ -1163,7 +1163,7 @@

    In general, the Next Scripting Framework supports multiple object systems concurrently. Effectively, every object system has different base classes for creating objects and classes. Therefore, these object -systems can have different different interfaces and names of built-in +systems can have different interfaces and names of built-in methods. Currently, the Next Scripting Framework is packaged with three object systems:

    +
    # Methods for defining methods:
    +#
    +#     proc
    +#     instproc
    +#     forward
    +#     instforward
    +#     parametercmd
    +#     instparametercmd
    +#
    +# All these methods return empty.
    -
    # Methods for defining methods:
    -#
    -#     alias
    -#     forward
    -#     method
    -#
    -# All these methods return method-handles.
    +
    # Methods for defining methods:
    +#
    +#     alias
    +#     forward
    +#     method
    +#
    +# All these methods return method-handles.
    @@ -1541,7 +1541,7 @@ parameters are defined (see Section 3.4).

    In NX forwarders are called forward. NX does not provide an public available method to define variable accessors like parametercmd in -XOTcl, but use interanlly the Next Scripting Framework primitive +XOTcl, but use internally the Next Scripting Framework primitive nsf::method::setter when appropriate.

    -
    # Define forwarder
    +
    # Define forwarder
     
     Class create C {
       :forward f1 ...
    @@ -1609,9 +1609,9 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Define setter and getter methods in XOTcl.
    -#
    -# XOTcl provides methods for these.
    +
    # Define setter and getter methods in XOTcl.
    +#
    +# XOTcl provides methods for these.
     
     Class C
     C instparametercmd p1
    @@ -1630,12 +1630,12 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Define setter and getter methods in NX.
    -#
    -# NX does not provide own methods, but uses
    -# the low level framework commands, since
    -# application developer will only seldomly
    -# need it.
    +
    # Define setter and getter methods in NX.
    +#
    +# NX does not provide own methods, but uses
    +# the low level framework commands, since
    +# application developer will only seldomly
    +# need it.
     
     Class create C
     ::nsf::method::setter C p1
    @@ -1679,7 +1679,7 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Method "alias" not available
    +
    # Method "alias" not available
    +
    # Method modifiers
    +#
    +#   "object",
    +#   "public",
    +#   "protected", and
    +#   "private"
    +#
    +# are not available
    +
    # XOTcl provides no means for
    +# method hiding
    +s1 foo 3 4 ;# returns 7 +s1 bar 3 4 ;# returns 12 +s1 baz 3 4 ;# unable to dispatch method 'baz'
    -
    # Define method aliases
    -# (to scripted or non-scripted methods)
    +
    # Define method aliases
    +# (to scripted or non-scripted methods)
     
     Class create C {
       :alias a1 ...
    @@ -1740,14 +1740,14 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Method modifiers
    -#
    -#   "object",
    -#   "public",
    -#   "protected", and
    -#   "private"
    -#
    -# are not available
    -
    # Method modifiers
    -#
    -#   "object",
    -#   "public",
    -#   "protected"
    -#
    -# are applicable for all kinds of
    -# method defining methods:
    -#
    -#    method, forward, alias
    -#
    -# The modifier "private" is available for
    -#
    -#    method, forward, alias
    -#
    +
    # Method modifiers
    +#
    +#   "object",
    +#   "public",
    +#   "protected"
    +#
    +# are applicable for all kinds of
    +# method defining methods:
    +#
    +#    method, forward, alias
    +#
    +# The modifier "private" is available for
    +#
    +#    method, forward, alias
    +#
     Class create C {
       :/method-definiton-method/ ...
       :public /method-definiton-method/ ...
    @@ -1824,8 +1824,8 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # XOTcl provides no means for
    -# method hiding
    -
    # Hiding of methods via "private"
    -#
    +
    # Hiding of methods via "private"
    +#
     nx::Class create Base {
    -  :private method baz {a b} {expr {$a + $b}}
    -  :public method foo {a b} {: -local baz $a $b}
    +  :private method baz {a b} {expr {$a + $b}}
    +  :public method foo {a b} {: -local baz $a $b}
     }
     
     nx::Class create Sub -superclass Base {
    -  :public method bar {a b} {: -local baz $a $b}
    -  :private method baz {a b} {expr {$a * $b}}
    +  :public method bar {a b} {: -local baz $a $b}
    +  :private method baz {a b} {expr {$a * $b}}
     
       :create s1
     }
     
    -s1 foo 3 4  ;# returns 7
    -s1 bar 3 4  ;# returns 12
    -s1 baz 3 4  ;# unable to dispatch method 'baz'
    @@ -1888,8 +1888,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # XOTcl provides only method deletion with
    -# the equivalent of Tcl's "proc foo {} {}"
    +
    # XOTcl provides only method deletion with
    +# the equivalent of Tcl's "proc foo {} {}"
     /cls/ instproc foo {} {}
     /obj/ proc foo {} {}
    @@ -1903,8 +1903,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Deletion of Methods
    -#
    +
    # Deletion of Methods
    +#
     /cls/ delete method /name/
     /obj/ delete object method /name/
    @@ -1960,8 +1960,8 @@
    Class C
     C instproc foo args {...}
     C instproc bar args {
    -  my foo 1 2 3 ;# invoke own method
    -  o baz        ;# invoke other object's method
    +  my foo 1 2 3 ;# invoke own method
    +  o baz        ;# invoke other object's method
     }
     Object o
     o proc baz {} {...}
    @@ -1979,8 +1979,8 @@
    Class create C {
       :method foo args {...}
       :method bar args {
    -     :foo 1 2 3 ;# invoke own method
    -     o baz      ;# invoke other object's method
    +     :foo 1 2 3 ;# invoke own method
    +     o baz      ;# invoke other object's method
       }
     }
     Object create o {
    @@ -2054,12 +2054,12 @@
     
     
    Class C
     C instproc foo args {
    -  # Method scoped variable a
    +  # Method scoped variable a
       set a 1
    -  # Instance variable b
    +  # Instance variable b
       my instvar b
       set b 2
    -  # Global variable/namespaced variable c
    +  # Global variable/namespaced variable c
       set ::c 3
     }
    @@ -2075,11 +2075,11 @@
    Class create C {
       :method foo args {...}
    -    # Method scoped variable a
    +    # Method scoped variable a
         set a 1
    -    # Instance variable b
    +    # Instance variable b
         set :b 2
    -    # Global variable/namespaced variable c
    +    # Global variable/namespaced variable c
         set ::c 3
       }
     }
    @@ -2110,8 +2110,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Set own instance variable to a value via
    -# resolver (preferred and fastest way)
    +
    # Set own instance variable to a value via
    +# resolver (preferred and fastest way)
     
     ... method ... {
        set :/newVar/ ?value?
    @@ -2144,8 +2144,8 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Set own instance variable via
    -# variable import
    +
    # Set own instance variable via
    +# variable import
     
     ... method ... {
        ::nx::var import [self] /varName/
    @@ -2178,7 +2178,7 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Read own instance variable
    +
    # Read own instance variable
     
     ... method ... {
        set /varName/ [set :/otherVar/]
    @@ -2195,7 +2195,7 @@
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
     
    ... method ... {
    -   set /newVar/ ${:/otherVar/}
    +   set /newVar/ ${:/otherVar/}
     }
    @@ -2224,7 +2224,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Test existence of own instance variable
    +
    # Test existence of own instance variable
     
     ... method ... {
        info :/varName/
    @@ -2288,9 +2288,9 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Set instance variable of object obj to a
    -# value via resolver
    -# (preferred way: define property on obj)
    +
    # Set instance variable of object obj to a
    +# value via resolver
    +# (preferred way: define property on obj)
     
     /obj/ eval [list set :/varName/ ?value?]
    @@ -2318,8 +2318,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Read instance variable of object obj
    -# via resolver
    +
    # Read instance variable of object obj
    +# via resolver
     
     set /varName/ [/obj/ eval {set :/otherVar/}]
    @@ -2350,8 +2350,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Read instance variable of object /obj/
    -# via import
    +
    # Read instance variable of object /obj/
    +# via import
     
     ... method ... {
        ::nx::var import /obj/ /varName/
    @@ -2382,8 +2382,8 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Test existence of instance variable of
    -# object obj
    +
    # Test existence of instance variable of
    +# object obj
     
     /obj/ eval {info exists :/varName/}
    @@ -2494,10 +2494,10 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Define class "Foo" with instance
    -# variables "x" and "y" initialized
    -# on instance creation. The initialization
    -# has to be performed in the constructor.
    +
    # Define class "Foo" with instance
    +# variables "x" and "y" initialized
    +# on instance creation. The initialization
    +# has to be performed in the constructor.
     
     Class Foo
     Foo instproc init args {
    @@ -2506,11 +2506,11 @@
        set y 2
     }
     
    -# Create instance of the class Foo
    +# Create instance of the class Foo
     Foo f1
     
    -# Object f1 has instance variables
    -# x == 1 and y == 2
    +# Object f1 has instance variables +# x == 1 and y == 2
    -
    # Define class "Foo" with instance variables
    -# "x" and "y" initialized on instance creation.
    -# The method "variable" is similar in syntax
    -# to Tcl's "variable" command. During
    -# instance creation, the variable
    -# definitions are used for the
    -# initialization of the variables of the object.
    +
    # Define class "Foo" with instance variables
    +# "x" and "y" initialized on instance creation.
    +# The method "variable" is similar in syntax
    +# to Tcl's "variable" command. During
    +# instance creation, the variable
    +# definitions are used for the
    +# initialization of the variables of the object.
     
     Class create Foo {
       :variable x 1
       :variable y 2
     }
     
    -# Create instance of the class Foo
    +# Create instance of the class Foo
     Foo create f1
     
    -# Object f1 has instance variables
    -# x == 1 and y == 2
    +# Object f1 has instance variables +# x == 1 and y == 2
    @@ -2552,7 +2552,7 @@ assign statements in the constructor requires explicit constructor calls, which are often error-prone. Certainly, when a user prefers to assign initial values to instance variables via explicit assign -operations in constructors, this is as ell possible in NX.

    +operations in constructors, this is as well possible in NX.

    NX uses the same mechanism to define class variables or object variables.

    @@ -2581,8 +2581,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # No syntactic support for creating
    -# class variables
    +
    # No syntactic support for creating
    +# class variables
    -# Define a object variable "V" with value 100 and
    -# an instance variable "x". "V" is defined for the
    -# class object Foo, "x" is defined in the
    -# instances of the class. "object variable" works
    -# similar to "object method".
    +# Define a object variable "V" with value 100 and
    +# an instance variable "x". "V" is defined for the
    +# class object Foo, "x" is defined in the
    +# instances of the class. "object variable" works
    +# similar to "object method".
     
     Class create Foo {
       :object variable V 100
    @@ -2612,8 +2612,8 @@
     

    In the next step, we define configurable instance variables which we call properties in NX.

    XOTcl uses the method parameter is a shortcut for creating multiple -configurable variables with automically created accessors (methods for -reading and writing of the variables). In NX, the prefered way to +configurable variables with automatically created accessors (methods for +reading and writing of the variables). In NX, the preferred way to create configurable variables is to use the method property. The method property in NX is similar to variable, but makes the variables configurable, which means that

    @@ -2662,25 +2662,25 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Parameters specified as a list
    -# (short form); parameter
    -# "a" has no default, "b" has default "1"
    +
    # Parameters specified as a list
    +# (short form); parameter
    +# "a" has no default, "b" has default "1"
     
     Class Foo -parameter {a {b 1}}
     
    -# Create instance of the class Foo
    +# Create instance of the class Foo
     Foo f1 -a 0
     
    -# Object f1 has instance variables
    -# a == 0 and b == 1
    +# Object f1 has instance variables
    +# a == 0 and b == 1
     
    -# XOTcl registers automatically accessors
    -# for the parameters. Use the accessor
    -# "b" to output the value of variable "b"
    +# XOTcl registers automatically accessors
    +# for the parameters. Use the accessor
    +# "b" to output the value of variable "b"
     puts [f1 b]
     
    -# Use the setter to alter value of
    -# instance variable "b"
    +# Use the setter to alter value of
    +# instance variable "b"
     f1 b 100
    -
    # Define property "a" and "b". The
    -# property "a" has no default, "b" has
    -# default value "1"
    +
    # Define property "a" and "b". The
    +# property "a" has no default, "b" has
    +# default value "1"
     
     Class create Foo {
       :property a
       :property {b 1}
     }
     
    -# Create instance of the class Foo
    +# Create instance of the class Foo
     Foo create f1 -a 0
     
    -# Object f1 has instance variables
    -# a == 0 and b == 1
    +# Object f1 has instance variables
    +# a == 0 and b == 1
     
    -# Use the method "cget" to query the value
    -# of a configuration parameter
    +# Use the method "cget" to query the value
    +# of a configuration parameter
     puts [f1 cget -b]
     
    -# Use the method "configure" to alter the
    -# value of instance variable "b"
    +# Use the method "configure" to alter the
    +# value of instance variable "b"
     f1 configure -b 100
    @@ -2751,23 +2751,23 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # "parameter" creates always accessor
    -# methods, accessor methods are
    -# always public, no "cget" is available.
    +
    # "parameter" creates always accessor
    +# methods, accessor methods are
    +# always public, no "cget" is available.
     
     Class create Foo -parameter {a {b1}}
     
    -# Use the accessor method to query
    -# the value of a configuration parameter
    +# Use the accessor method to query
    +# the value of a configuration parameter
     puts [f1 b]
     
    -# Use the accessor method to set the
    -# value of instance variable "a"
    +# Use the accessor method to set the
    +# value of instance variable "a"
     f1 a 100
     
    -# Use the accessor method to unset the
    -# value of instance variable "a" n.a. via
    -# accessor
    +# Use the accessor method to unset the +# value of instance variable "a" n.a. via +# accessor
    -
    # Define property "a" and "b". The
    -# property "a" has no default, "b" has
    -# default value "1"
    +
    # Define property "a" and "b". The
    +# property "a" has no default, "b" has
    +# default value "1"
     
     Class create Foo {
       :variable -accessor public a
       :property -accessor public {b 1}
     }
     
    -# Use the accessor method to query
    -# the value of a configuration parameter
    +# Use the accessor method to query
    +# the value of a configuration parameter
     puts [f1 b get]
     
    -# Use the accessor method to set the
    -# value of instance variable "a"
    +# Use the accessor method to set the
    +# value of instance variable "a"
     f1 a set 100
     
    -# Use the accessor method to unset the
    -# value of instance variable "a"
    +# Use the accessor method to unset the
    +# value of instance variable "a"
     f1 a unset
    @@ -2831,9 +2831,9 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # XOTcl provides no means to define
    -# configurable variables at the object
    -# level
    +
    # XOTcl provides no means to define
    +# configurable variables at the object
    +# level
    -
    # Define class with a property for the class object
    -# named "cp". This is similar to "static variables"
    -# in some other object-oriented programming
    -# languages.
    +
    # Define class with a property for the class object
    +# named "cp". This is similar to "static variables"
    +# in some other object-oriented programming
    +# languages.
     
     Class create Foo {
       ...
       :object property cp 101
     }
     
    -# Define object property "op"
    +# Define object property "op"
     
     Object create o {
       :object property op 102
    @@ -2897,8 +2897,8 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # No value constraints for
    -# parameter available
    +
    # No value constraints for
    +# parameter available
    -
    # Predefined value constraints:
    -#    object, class, alnum, alpha, ascii, boolean,
    -#    control, digit, double, false, graph, integer,
    -#    lower, parameter, print, punct, space, true,
    -#    upper, wordchar, xdigit
    -#
    -# User defined value constraints are possible.
    -# All parameter value checkers can be turned on
    -# and off at runtime.
    -#
    -# Define a required boolean property "a"
    -# and an integer property "b" with a default.
    -# The first definition uses "properties",
    -# the second definition uses multiple
    -# "property" statements.
    +
    # Predefined value constraints:
    +#    object, class, alnum, alpha, ascii, boolean,
    +#    control, digit, double, false, graph, integer,
    +#    lower, parameter, print, punct, space, true,
    +#    upper, wordchar, xdigit
    +#
    +# User defined value constraints are possible.
    +# All parameter value checkers can be turned on
    +# and off at runtime.
    +#
    +# Define a required boolean property "a"
    +# and an integer property "b" with a default.
    +# The first definition uses "properties",
    +# the second definition uses multiple
    +# "property" statements.
     
     Class create Foo -properties {
        a:boolean
    @@ -2953,7 +2953,7 @@
     to be passed to the constructor of the object.

    NX allows to define optional and required configure parameters (as well as method parameters). Therefore, configure parameters can be used -as the single mechanism to parameterize objects. It is in NX not +as the single mechanism to parametrize objects. It is in NX not necessary (and per default not possible) to pass arguments to the constructor.

    @@ -2982,7 +2982,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Required parameter not available
    +
    # Required parameter not available
    -
    # Required parameter:
    -# Define a required property "a" and a
    -# required boolean property "b"
    +
    # Required parameter:
    +# Define a required property "a" and a
    +# required boolean property "b"
     
     Class create Foo -properties {
        a:required
    @@ -3053,8 +3053,8 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Multiplicity for parameter
    -# not available
    +
    # Multiplicity for parameter
    +# not available
    -
    # Parameter with multiplicity
    -#   ints is a list of integers, with default
    -#   objs is a non-empty list of objects
    -#   obj is a single object, maybe empty
    +
    # Parameter with multiplicity
    +#   ints is a list of integers, with default
    +#   objs is a non-empty list of objects
    +#   obj is a single object, maybe empty
     
     Class create Foo -properties {
       {ints:integer,0..n ""}
    @@ -3148,19 +3148,19 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Define parameters via slots
    +
    # Define parameters via slots
     
     Class Foo -slots {
        Attribute a
        Attribute b -default 1
     }
     
    -# Create instance of the class Foo
    -# and provide a value for instance
    -# variable "a"
    +# Create instance of the class Foo
    +# and provide a value for instance
    +# variable "a"
     Foo f1 -a 0
     
    -# Object f1 has a == 0 and b == 1
    +# Object f1 has a == 0 and b == 1
    -
    # Configurable parameters specified via the
    -# method "property" (supports method
    -# modifiers and scripted configuration;
    -# see below)
    +
    # Configurable parameters specified via the
    +# method "property" (supports method
    +# modifiers and scripted configuration;
    +# see below)
     
     Class create Foo {
        :property a
        :property {b 1}
     }
     
    -# Create instance of the class Foo and
    -# provide a value for instance variable "a"
    +# Create instance of the class Foo and
    +# provide a value for instance variable "a"
     Foo create f1 -a 0
     
    -# Object f1 has a == 0 and b == 1
    +# Object f1 has a == 0 and b == 1

    Since the slots are objects, the slot objects can be configured and -parameterized like every other object in NX. Slot objects can be +parametrized like every other object in NX. Slot objects can be provided with a scripted initialization as well. We show first the definition of properties simliar to the functionality provided as well by XOTcl and show afterwards how to use value constraints, optional @@ -3223,13 +3223,13 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -

    # Define parameter with an an
    -# attribute-specific type checker
    +
    # Define parameter with an an
    +# attribute-specific type checker
     
     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 {
    @@ -3250,16 +3250,16 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Configure parameter with scripted
    -# definition (init-block), defining a
    -# property specific type checker
    +
    # Configure parameter with scripted
    +# definition (init-block), defining a
    +# property specific type checker
     
     Class create Person {
         :property -accessor public sex:sex,convert {
     
    -      # define a converter to standardize representation
    +      # define a converter to standardize representation
           :object method type=sex {name value} {
    -        switch -glob $value {
    +        switch -glob $value {
               m* {return m}
               f* {return f}
               default {error "expected sex but got $value"}
    @@ -3305,8 +3305,8 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # No syntactic support for deleting
    -# variable handlers
    +
    # No syntactic support for deleting
    +# variable handlers
    -
    # Like deletion of Methods:
    -# Delete on the object, where the
    -# variable handler is defined.
    +
    # Like deletion of Methods:
    +# Delete on the object, where the
    +# variable handler is defined.
     
     /cls/ delete property /name/
     /obj/ delete object property /name/
    @@ -3368,9 +3368,9 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # Define method foo with non-positional
    -# parameters (x, y and y) and positional
    -# parameter (a and b)
    +
    # Define method foo with non-positional
    +# parameters (x, y and y) and positional
    +# parameter (a and b)
     
     Class C
     C instproc foo {
    @@ -3380,11 +3380,11 @@
        a
        b
     } {
    -   # ...
    +   # ...
     }
     C create c1
     
    -# invoke method foo
    +# invoke method foo
     c1 foo -x 1 -y a 2 3
    -
    # Define method foo with
    -# non-positional parameters
    -# (x, y and y) and positional
    -# parameter (a and b)
    +
    # Define method foo with
    +# non-positional parameters
    +# (x, y and y) and positional
    +# parameter (a and b)
     
     Class create C {
        :public method foo {
    @@ -3410,11 +3410,11 @@
           a
           b
        } {
    -      # ...
    +      # ...
        }
        :create c1
     }
    -# invoke method foo
    +# invoke method foo
     c1 foo -x 1 -y a 2 3
    @@ -3429,12 +3429,12 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Only leading non-positional
    -# parameters are available; no
    -# optional positional parameters,
    -# no value constraints on
    -# positional parameters,
    -# no multiplicity, ...
    +
    # Only leading non-positional
    +# parameters are available; no
    +# optional positional parameters,
    +# no value constraints on
    +# positional parameters,
    +# no multiplicity, ...
    -
    # Define various forms of parameters
    -# not available in XOTcl 1
    +
    # Define various forms of parameters
    +# not available in XOTcl 1
     
     Class create C {
    -  # trailing (or interleaved) non-positional
    -  # parameters
    +  # trailing (or interleaved) non-positional
    +  # parameters
       :public method m1 {a b -x:integer -y} {
    -    # ...
    +    # ...
       }
     
    -  # positional parameters with value constraints
    +  # positional parameters with value constraints
       :public method m2 {a:integer b:boolean} {
    -    #...
    +    #...
       }
     
    -  # optional positional parameter (trailing)
    +  # optional positional parameter (trailing)
       :public method set {varName value:optional} {
    -    # ....
    +    # ....
       }
     
    -  # parameter with multiplicity
    +  # parameter with multiplicity
       :public method m3 {-objs:object,1..n c:class,0..1} {
    -    # ...
    +    # ...
       }
     
    -  # In general, the same list of value
    -  # constraints as for configure parameter is
    -  # available (see above).
    -  #
    -  # User defined value constraints are
    -  # possible. All parameter value checkers
    -  # can be turned on and off.
    +  # In general, the same list of value
    +  # constraints as for configure parameter is
    +  # available (see above).
    +  #
    +  # User defined value constraints are
    +  # possible. All parameter value checkers
    +  # can be turned on and off.
     }
    @@ -3518,8 +3518,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # No return value checking
    -# available
    +
    # No return value checking
    +# available
    -
    # Define method foo with non-positional
    -# parameters (x, y and y) and positional
    -# parameter (a and b)
    +
    # Define method foo with non-positional
    +# parameters (x, y and y) and positional
    +# parameter (a and b)
     
     Class create C {
     
    -  # Define method foo which returns an
    -  # integer value
    +  # Define method foo which returns an
    +  # integer value
       :method foo -returns integer {-x:integer} {
    -    # ...
    +    # ...
        }
     
    -  # Define an alias for the Tcl command ::incr
    -  # and assure, it always returns an integer
    -  # value
    +  # Define an alias for the Tcl command ::incr
    +  # and assure, it always returns an integer
    +  # value
       :alias incr -returns integer ::incr
     
    -  # Define a forwarder that has to return an
    -  # integer value
    +  # Define a forwarder that has to return an
    +  # integer value
       :forward ++ -returns integer ::expr 1 +
     
    - # Define a method that has to return a
    - # non-empty list of objects
    + # Define a method that has to return a
    + # non-empty list of objects
      :public object method instances {} \
         -returns object,1..n {
        return [:info instances]
    @@ -3571,7 +3571,7 @@
     namely class- and object-level mixins and class- and object-level
     filters. The primary difference in NX is the naming, since NX abandons
     the prefix "inst" from the names of instance specific method, but uses
    -the the modifier objec" for object specific methods.

    +the modifier object" for object specific methods.

    Therefore, in NX, if a mixin is registered on a class-level, it is applicable for the instances (a per-class mixin), and if and object mixin is registered, it is a per-object mixin. In both cases, the @@ -3609,7 +3609,7 @@

    /cls/ instmixin ...
     /cls/ instmixinguard /mixin/ ?condition?
     
    -# Query per-class mixin
    +# Query per-class mixin
     /cls/ instmixin
    -
    # Register/clear per-class mixin and guard for
    -# a class
    +
    # Register/clear per-class mixin and guard for
    +# a class
     
     /cls/ mixins add|set|clear ...
     /cls/ mixins guard /mixin/ ?condition?
     /cls/ configure -mixin ...
     
    -# Query per-class mixins
    +# Query per-class mixins
     /cls/ mixins get
     /cls/ cget -mixins
     
    -# Query per-class mixins (without guards)
    +# Query per-class mixins (without guards)
     /cls/ mixins classes
    @@ -3651,7 +3651,7 @@
    /obj/ mixin ...
     /obj/ mixinguard /mixin/ ?condition?
     
    -# Query per-object mixins
    +# Query per-object mixins
     /obj/ mixin
    -
    # Register/clear per-object mixin and guard for
    -# an object
    +
    # Register/clear per-object mixin and guard for
    +# an object
     
     /obj/ object mixins add|set|clear ...
     /obj/ object mixins guard /mixin/ ?condition?
     /obj/ configure -object-mixins ...
     
    -# Query per-object mixin
    +# Query per-object mixin
     /obj/ object mixins get
     /obj/ cget -object-mixin
     
    -# Query per-object mixins (without guards)
    +# Query per-object mixins (without guards)
     /cls/ mixins classes
    @@ -3710,12 +3710,12 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Register per-class filter and guard for
    -# a class
    +
    # Register per-class filter and guard for
    +# a class
     /cls/ instfilter ...
     /cls/ instfilterguard /filter/ ?condition?
     
    -# Query per-class filter
    +# Query per-class filter
     /cls/ instfilter
    -
    # Register/clear per-class filter and guard for
    -# a class
    +
    # Register/clear per-class filter and guard for
    +# a class
     
     /cls/ filters add|set|clear ...
     /cls/ filters guard /filter/ ?condition?
     /cls/ configure -filters ...
     
    -# Query per-class filters
    +# Query per-class filters
     /cls/ filters get
     /cls/ cget -filters
     
    -# Query per-class filters (without guards)
    +# Query per-class filters (without guards)
     /cls/ filters methods
    @@ -3767,18 +3767,18 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Register(clear per-object filter and guard for
    -# an object
    +
    # Register(clear per-object filter and guard for
    +# an object
     
     /obj/ object filters add|set|clear ...
     /obj/ object filters guard /filter/ ?condition?
     /obj/ configure -object-filters ...
     
    -# Query per-object filters
    +# Query per-object filters
     /cls/ object filters get
     /obj/ cget -object-filters
     
    -# Query per-object filters (without guards)
    +# Query per-object filters (without guards)
     /cls/ object filters methods
    @@ -3795,7 +3795,7 @@

    In NX, one can use e.g. always info method with a subcommand and the framework tries to hide the differences as far as possible. So, one can for example obtain with info method parameter the parameters of -scripted and C-implemented methods the same way, one one can get the +scripted and C-implemented methods the same way, one can get the definition of all methods via info method definition and one can get an manual-like interface description via info method syntax. In addition, NX provides means to query the type of @@ -3985,7 +3985,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -

    # n.a.
    +
    # n.a.
    -
    # n.a.
    +
    # n.a.
    /obj/ info lookup methods ... ?pattern?
    -# Returns list of method names
    +# Returns list of method names
    @@ -4254,7 +4254,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # List only application specific methods
    +
    # List only application specific methods
     /obj/ info lookup methods -source application ... ?pattern?
    -# Returns list of method names
    +# Returns list of method names
    @@ -4282,10 +4282,10 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Options for 'info methods'
    -#
    -# -incontext
    -# -nomixins
    +
    # Options for 'info methods'
    +#
    +# -incontext
    +# -nomixins
    -
    # Options for 'info lookup methods'
    -#
    -# -source ...
    -# -callprotection ...
    -# -incontext
    -# -type ...
    -# -nomixins
    +
    # Options for 'info lookup methods'
    +#
    +# -source ...
    +# -callprotection ...
    +# -incontext
    +# -type ...
    +# -nomixins
    @@ -4317,7 +4317,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # List slot objects defined for obj
    -# -source might be all|application|baseclasses
    -# -type is the class of the slot object
    +
    # List slot objects defined for obj
    +# -source might be all|application|baseclasses
    +# -type is the class of the slot object
     
     /obj/ info lookup slots ?-type ...? ?-source ...? ?pattern?
     
    -# Returns list of slot objects
    +# Returns list of slot objects
    @@ -4349,10 +4349,10 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # List registered filters
    +
    # List registered filters
     /obj/ info filters -order ?-guards? ?pattern?
     
    -# List registered mixins
    +# List registered mixins
     /obj/ info mixins -heritage ?-guards? ?pattern?
    -
    # List registered filters
    +
    # List registered filters
     /obj/ info lookup filters ?-guards? ?pattern?
     
    -# List registered mixins
    +# List registered mixins
     /obj/ info lookup mixins ?-guards? ?pattern?
    @@ -4422,7 +4422,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
    /obj/ info lookup method /methodName/
    -# Returns method-handle
    +# Returns method-handle
    @@ -4449,7 +4449,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
    /obj/ info lookup filter /methodName/
    -# Returns method-handle
    +# Returns method-handle
    @@ -4495,7 +4495,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # not needed, part of
    -# "info ?object? method parameter"
    +
    # not needed, part of
    +# "info ?object? method parameter"
    @@ -4711,7 +4711,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # n.a.
    +
    # n.a.
    -
    # Return the parameters applicable to
    -# the create method of a certain class.
    -# class can be configured. A pattern can
    -# be used to filter the results.
    +
    # Return the parameters applicable to
    +# the create method of a certain class.
    +# class can be configured. A pattern can
    +# be used to filter the results.
     
     /cls/ info lookup parameters create ?/pattern/?
     
    -# Return in the result in documentation syntax
    +# Return in the result in documentation syntax
     
     /cls/ info lookup syntax create ?/pattern/?
     
    -# "info lookup parameters configure" returns
    -# parameters available for configuring the
    -# current object  (might contain object
    -# specific information)
    +# "info lookup parameters configure" returns
    +# parameters available for configuring the
    +# current object  (might contain object
    +# specific information)
     
     /obj/ info lookup parameters configure ?pattern?
     
    -# "info lookup configure syntax" returns syntax of
    -# a call to configure in the Tcl parameter syntax
    +# "info lookup configure syntax" returns syntax of
    +# a call to configure in the Tcl parameter syntax
     
     /obj/ info lookup syntax configure
     
    -# Obtain information from a parameter
    -# (as e.g. returned from "info lookup
    -# parameters configure").
    +# Obtain information from a parameter
    +# (as e.g. returned from "info lookup
    +# parameters configure").
     
     nsf::parameter::info name /parameter/
     nsf::parameter::info syntax /parameter/
    @@ -4838,8 +4838,8 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # obtain parameter definitions defined
    -# for a class
    +
    # obtain parameter definitions defined
    +# for a class
     /cls/ info parameter
    -
    # "info variables" returns handles of
    -# properties and variables defined by this
    -# class or object
    +
    # "info variables" returns handles of
    +# properties and variables defined by this
    +# class or object
     
     /cls/ info variables ?pattern?
     /obj/ info object variables ?pattern?
     
    -# "info lookup variables" returns handles
    -# of variables and properties applicable
    -# for the current object (might contain
    -# object specific information)
    +# "info lookup variables" returns handles
    +# of variables and properties applicable
    +# for the current object (might contain
    +# object specific information)
     
     /obj/ info lookup variables /pattern/
     
    -# "info variable" lists details about a
    -# single property or variable.
    +# "info variable" lists details about a
    +# single property or variable.
     
     /obj/ info variable definition /handle/
     /obj/ info variable name /handle/
    @@ -4905,7 +4905,7 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # n.a.
    +
    # n.a.
    -
    # Return list of slots objects defined on the
    -# object or class
    -#
    -# -source might be all|application|baseclasses
    -# -type is the class of the slot object
    -# -closure includes slots of superclasses
    +
    # Return list of slots objects defined on the
    +# object or class
    +#
    +# -source might be all|application|baseclasses
    +# -type is the class of the slot object
    +# -closure includes slots of superclasses
     
     /cls/ info slots \
        ?-type value? ?-closure? ?-source value? ?pattern?
     /obj/ info object slots ?-type ...? ?pattern?
     
    -# List reachable slot objects defined for obj
    -# -source might be all|application|baseclasses
    -# -type is the class of the slot object
    -# Returns list of slot objects.
    +# List reachable slot objects defined for obj
    +# -source might be all|application|baseclasses
    +# -type is the class of the slot object
    +# Returns list of slot objects.
     
     /obj/ info lookup slots \
        ?-type ...? ?-source ... ?pattern?
     
    -# Obtain definition, name or parameter from
    -# slot object
    +# Obtain definition, name or parameter from
    +# slot object
     
     /slotobj/ definition
     /slotobj/ name
    @@ -5115,7 +5115,7 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # n.a.
    +
    # n.a.
    -
    # n.a.
    +
    # n.a.
    -
    #
    -# List the method handle of the specified method,
    -# can be used e.g. for aliases. "handle" is the short
    -# form of "definitionhandle".
    -#
    +
    #
    +# List the method handle of the specified method,
    +# can be used e.g. for aliases. "handle" is the short
    +# form of "definitionhandle".
    +#
     /cls/ info method handle /methodName/
     /obj/ info object 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.
    -#
    +#
    +# 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.
    +#
     /cls/ info method registrationhandle /methodName/
     /obj/ info object method registrationhandle /methodName/
    -#
    -# For aliases, one can query the original
    -# definition via "info method origin"
    -#
    +#
    +# For aliases, one can query the original
    +# definition via "info method origin"
    +#
     /cls/ info method origin /methodName/
     /obj/ info object method origin /methodName/
    @@ -5235,7 +5235,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # List objects, where /cls/ is a
    -# per-object mixin
    +
    # List objects, where /cls/ is a
    +# per-object mixin
     
     /cls/ info mixinof -scope object ?-closure? \
        ?pattern?
    @@ -5326,7 +5326,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # List classes, where /cls/ is a per-class mixin
    +
    # List classes, where /cls/ is a per-class mixin
     
     /cls/ info mixinof -scope class ?-closure? \
        ?pattern?
    @@ -5343,7 +5343,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # List objects and classes, where /cls/ is
    -# either a per-object or a per-class mixin
    +
    # List objects and classes, where /cls/ is
    +# either a per-object or a per-class mixin
     
     /cls/ info mixinof -scope all ?-closure? \
        ?pattern?
    @@ -5419,7 +5419,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Check if object is a subtype of some class
    +
    # Check if object is a subtype of some class
     /obj/ info has type /sometype/
    @@ -5446,7 +5446,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Check if object has the specified mixin registered
    +
    # Check if object has the specified mixin registered
     /obj/ info has mixin /cls/
    @@ -5473,11 +5473,11 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Check if object is an NX class
    +
    # Check if object is an NX class
     /obj/ has type ::nx::Class
     
    -# Check if object is a class in one of the
    -# NSF object systems
    +# Check if object is a class in one of the
    +# NSF object systems
     ::nsf::is class /obj/
    @@ -5504,11 +5504,11 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Check if class is an NX metaclass
    +
    # Check if class is an NX metaclass
     expr {[/cls/ info heritage ::nx::Class] ne ""}
     
    -# Check if object is a metaclass in one of the
    -# NSF object systems
    +# Check if object is a metaclass in one of the
    +# NSF object systems
     ::nsf::is metaclass /obj/
    @@ -5523,7 +5523,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # Check if object is a baseclass of an object system
    +
    # Check if object is a baseclass of an object system
     ::nsf::is baseclass /obj/
    @@ -5550,7 +5550,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # Return name of object (without namespace prefix)
    +
    # Return name of object (without namespace prefix)
     /obj/ info name
    @@ -5589,7 +5589,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Check for existence of object (nsf primitive)
    +
    # Check for existence of object (nsf primitive)
     ::nsf::object::exists /obj/
    @@ -5912,8 +5912,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Returns method-handle of the
    -# method to be called via "next"
    +
    # Returns method-handle of the
    +# method to be called via "next"
     current next
    @@ -5940,8 +5940,8 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # Returns method-handle of the
    -# filter method
    +
    # Returns method-handle of the
    +# filter method
     current filterreg
    @@ -6055,7 +6055,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # n.a.
    +
    # n.a.
    -
    # XOTcl example
    +
    # XOTcl example
     
     Class Foo -parameter {x y}
     Foo f1 -x -y 1
    @@ -6374,7 +6374,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # XOTcl example
    +
    # XOTcl example
     
     Class Foo -parameter {{x 1}}
     Class Bar -superclass Foo -parameter x
    @@ -6398,12 +6398,12 @@
     .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;}
     .nx-variable    {color: #AF663F; font-weight: normal; font-style: normal;}
     
    -
    # NX example
    +
    # NX example
     
     nx::Class create Foo
     Foo create f1
     
    -# now alter the class of object f1
    +# now alter the class of object f1
     nsf::relation::set f1 class ::nx::Object
    @@ -6432,7 +6432,7 @@

    3.4. Obsolete Commands

    Parameter-classes were rarely used and have been replaced by the more -general object parameterization. Therefore, cl info parameterclass has +general object parametrization. Therefore, cl info parameterclass has been removed.

    @@ -6456,7 +6456,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
    # NX example
    +
    # NX example
     ::nsf::exithandler set|get|unset ?arg?
    @@ -6466,7 +6466,7 @@ Index: doc/next-tutorial/next-tutorial.html =================================================================== diff -u -rd8b8fec1b9c4b2ab7c1cc36c156649109ca0807a -rd303212e06bfd89c57038a26ba54f9f86e941601 --- doc/next-tutorial/next-tutorial.html (.../next-tutorial.html) (revision d8b8fec1b9c4b2ab7c1cc36c156649109ca0807a) +++ doc/next-tutorial/next-tutorial.html (.../next-tutorial.html) (revision d303212e06bfd89c57038a26ba54f9f86e941601) @@ -858,44 +858,25 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    -
    nx::Class create Stack {
    +
    nx::Class create Stack {
     
    -   #
    -   # Stack of Things
    -   #
    +   #
    +   # Stack of Things
    +   #
     
        :variable things {}
     
        :public method push {thing} {
    -      set :things [linsert ${:things} 0 $thing]
    -      return $thing
    +      set :things [linsert ${:things} 0 $thing]
    +      return $thing
        }
     
        :public method pop {} {
    -      set top [lindex ${:things} 0]
    -      set :things [lrange ${:things} 1 end]
    -      return $top
    +      set top [lindex ${:things} 0]
    +      set :things [lrange ${:things} 1 end]
    +      return $top
        }
    -}
    +}

    Typically, classes are defined in NX via nx::Class create, followed by the name of the new class (here: Stack). The definition of the stack placed between curly braces and contains here just the method @@ -952,32 +933,14 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    -
    #!/usr/bin/env tclsh
    +
    #!/usr/bin/env tclsh
     package require nx
     
     nx::Class create Stack {
     
    -   #
    -   # Stack of Things
    -   #
    +   #
    +   # Stack of Things
    +   #
        ....
     }
     
    @@ -987,7 +950,7 @@
     s1 push c
     puts [s1 pop]
     puts [s1 pop]
    -s1 destroy

    +s1 destroy

    Now we want to use the stack. The code snippet in Listing 3 shows how to use the class Stack in a script. Since NX is based on Tcl, the script will be called with the Tcl shell tclsh. In the Tcl shell we have to require package nx to use the @@ -1051,36 +1014,21 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    -
    nx::Object create stack {
    +
    nx::Object create stack {
     
        :object variable things {}
     
        :public object method push {thing} {
    -      set :things [linsert ${:things} 0 $thing]
    -      return $thing
    +      set :things [linsert ${:things} 0 $thing]
    +      return $thing
        }
     
        :public object method pop {} {
    -      set top [lindex ${:things} 0]
    -      set :things [lrange ${:things} 1 end]
    -      return $top
    +      set top [lindex ${:things} 0]
    +      set :things [lrange ${:things} 1 end]
    +      return $top
        }
    -}

    +}

    The example in Listing 5 defines the object stack in a very similar way as the class Stack. But the following points are different.

    @@ -1158,40 +1106,16 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    -
    nx::Class create Safety {
    +
    nx::Class create Safety {
     
    -  #
    -  # Implement stack safety by defining an additional
    -  # instance variable named "count" that keeps track of
    -  # the number of stacked elements. The methods of
    -  # this class have the same names and argument lists
    -  # as the methods of Stack; these methods "shadow"
    -  # the methods of class Stack.
    -  #
    +  #
    +  # Implement stack safety by defining an additional
    +  # instance variable named "count" that keeps track of
    +  # the number of stacked elements. The methods of
    +  # this class have the same names and argument lists
    +  # as the methods of Stack; these methods "shadow"
    +  # the methods of class Stack.
    +  #
     
       :variable count 0
     
    @@ -1201,11 +1125,11 @@
       }
     
       :public method pop {} {
    -    if {${:count} == 0} then { error "Stack empty!" }
    +    if {${:count} == 0} then { error "Stack empty!" }
         incr :count -1
         next
       }
    -}
    +}

    Note that all the methods of the class Safety end with next. This command is a primitive command of NX, which calls the same-named method with the same argument list as the current @@ -1230,29 +1154,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    -
    % package require nx
    +
    % package require nx
     2.0
     % source Stack.tcl
     ::Stack
    @@ -1273,7 +1175,7 @@
     ::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 @@ -1318,20 +1220,13 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -
    #
    -# Create a safe stack class by using Stack and mixin
    -# Safety
    -#
    +
    #
    +# Create a safe stack class by using Stack and mixin
    +# Safety
    +#
     nx::Class create SafeStack -superclass Stack -mixin Safety
     
    -SafeStack create s3

    +SafeStack create s3

    The difference of a per-class mixin and an per-object mixin is that the per-class mixin is applicable to all instances of the class. Therefore, we call these mixins also sometimes instance mixins. @@ -1373,28 +1268,17 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    -
    Stack create s4 {
    +
    Stack create s4 {
     
    -  #
    -  # Create a stack with a object-specific method
    -  # to check the type of entries
    -  #
    +  #
    +  # Create a stack with a object-specific method
    +  # to check the type of entries
    +  #
     
       :public object method push {thing:integer} {
         next
       }
    -}

    +}

    The program snippet in Listing 12 defines an instance s4 of the class Stack and provides an object specific method for push to implement an integer stack. The method pull is the same for the integer stack @@ -1420,26 +1304,16 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    -
    nx::Class create IntegerStack -superclass Stack {
    +
    nx::Class create IntegerStack -superclass Stack {
     
    -  #
    -  # Create a Stack accepting only integers
    -  #
    +  #
    +  # Create a Stack accepting only integers
    +  #
     
       :public method push {thing:integer} {
         next
       }
    -}

    +}

    An alternative approach is shown in Listing 13, where the class IntegerStack is defined, using the same method definition @@ -1473,31 +1347,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    -
    nx::Class create Stack2 {
    +
    nx::Class create Stack2 {
     
        :public object method available_stacks {} {
           return [llength [:info instances]]
    @@ -1506,21 +1356,21 @@
        :variable things {}
     
        :public method push {thing} {
    -      set :things [linsert ${:things} 0 $thing]
    -      return $thing
    +      set :things [linsert ${:things} 0 $thing]
    +      return $thing
        }
     
        :public method pop {} {
    -      set top [lindex ${:things} 0]
    -      set :things [lrange ${:things} 1 end]
    -      return $top
    +      set top [lindex ${:things} 0]
    +      set :things [lrange ${:things} 1 end]
    +      return $top
        }
     }
     
     Stack2 create s1
     Stack2 create s2
     
    -puts [Stack2 available_stacks]

    +puts [Stack2 available_stacks]

    The class Stack2 in Listing 14 consists of the earlier definition of the class Stack and is extended by the class-specific method available_stacks, which returns the @@ -1591,28 +1441,17 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    -
    nx::Class create Foo {
    +
    nx::Class create Foo {
     
       :method foo args {...}
    -    # "a" is a method scoped variable
    +    # "a" is a method scoped variable
         set a 1
    -    # "b" is an Instance variable
    +    # "b" is an Instance variable
         set :b 2
    -    # "c" is a global variable/namespaced variable
    +    # "c" is a global variable/namespaced variable
         set ::c 3
       }
    -}

    +}

    Listing 16 shows a method foo of some class Foo referring to differently scoped variables.

    @@ -1662,60 +1501,33 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    - 27
    -
    #
    -# Define a class Person with properties "name"
    -# and "birthday"
    -#
    +
    #
    +# Define a class Person with properties "name"
    +# and "birthday"
    +#
     nx::Class create Person {
       :property name:required
       :property birthday
     }
     
    -#
    -# Define a class Student as specialization of Person
    -# with additional properties
    -#
    +#
    +# Define a class Student as specialization of Person
    +# with additional properties
    +#
     nx::Class create Student -superclass Person {
       :property matnr:required
       :property {oncampus:boolean true}
     }
     
    -#
    -# Create instances using configure parameters
    -# for the initialization
    -#
    +#
    +# Create instances using configure parameters
    +# for the initialization
    +#
     Person create p1 -name Bob
     Student create s1 -name Susan -matnr 4711
     
    -# Access property value via accessor method
    -puts "The name of s1 is [s1 cget -name]"
    +# Access property value via accessor method +puts "The name of s1 is [s1 cget -name]"

    By defining name and birthday as properties of Person, NX makes these configurable. When we create an instance of Person named p1, we can provide a value for e.g. the name by specifying -name @@ -1772,36 +1584,21 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    -
    nx::Class create Base {
    +
    nx::Class create Base {
       :variable x 1
    -  # ...
    +  # ...
     }
     
     nx::Class create Derived -superclass Base {
       :variable y 2
    -  # ...
    +  # ...
     }
     
    -# Create instance of the class Derived
    +# Create instance of the class Derived
     Derived create d1
     
    -# Object d1 has instance variables
    -# x == 1 and y == 2

    +# Object d1 has instance variables +# x == 1 and y == 2

    Note that the variable definitions are inherited in the same way as properties. The example in Listing 19 shows a class Derived that inherits from Base. When an instance d1 is @@ -1820,44 +1617,25 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    -
    nx::Class create Base2 {
    - # ...
    +
    nx::Class create Base2 {
    + # ...
      :method init {} {
        set :x 1
    -   # ....
    +   # ....
      }
     }
     
     nx::Class create Derived2 -superclass Base2 {
    - # ...
    + # ...
      :method init {} {
        set :y 2
        next
    -   # ....
    +   # ....
      }
     }
     
    -# Create instance of the class Derived2
    -Derived2 create d2

    +# Create instance of the class Derived2 +Derived2 create d2

    In many other object oriented languages, the instance variables are initialized solely by the constructor (similar to class Derived2 in Listing 20). This approach is certainly @@ -1904,34 +1682,20 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    -
    # Define a class
    +
    # Define a class
     nx::Class create Dog {
     
    -  # Define a scripted method for the class
    +  # Define a scripted method for the class
       :public method bark {} {
         puts "[self] Bark, bark, bark."
       }
     }
     
    -# Create an instance of the class
    +# Create an instance of the class
     Dog create fido
     
    -# The following line prints "::fido Bark, bark, bark."
    -fido bark

    +# The following line prints "::fido Bark, bark, bark." +fido bark

    In the example above we create a class Dog with a scripted method named bark. The method body defines the code, which is executed when the method is invoked. In this example, the method bar prints out a @@ -1980,32 +1744,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    -
    nx::Class create Dog {
    +
    nx::Class create Dog {
      :public method bark {} { puts "[self] Bark, bark, bark." }
      :method init {} { Tail create [self]::tail}
     }
    @@ -2015,21 +1754,21 @@
       :public method wag {} {return Joy}
     }
     
    -# Create an instance of the class
    +# Create an instance of the class
     Dog create fido
     
    -# Use the accessor "length" as a getter, to obtain the value
    -# of a property. The following call returns the length of the
    -# tail of fido
    +# Use the accessor "length" as a getter, to obtain the value
    +# of a property. The following call returns the length of the
    +# tail of fido
     fido::tail length get
     
    -# Use the accessor "length" as a setter, to alter the value
    -# of a property. The following call changes the length of
    -# the tail of fido
    +# Use the accessor "length" as a setter, to alter the value
    +# of a property. The following call changes the length of
    +# the tail of fido
     fido::tail length set 10
     
    -# Proving an invalid values will raise an error
    -fido::tail length set "Hello"

    +# Proving an invalid values will raise an error +fido::tail length set "Hello"

    Listing 22 shows an extended example, where every dog has a tail. The object tail is created as a subobject of the dog in the constructor init. The subobject can be accessed by providing the @@ -2050,26 +1789,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    -
    nx::Class create Dog {
    +
    nx::Class create Dog {
       :public method bark {} { puts "[self] Bark, bark, bark." }
       :method init {} {
         Tail create [self]::tail
    @@ -2082,12 +1802,12 @@
       :public method wag {} {return Joy}
     }
     
    -# Create an instance of the class
    +# Create an instance of the class
     Dog create fido
     
    -# The invocation of "fido wag" is delegated to "fido::tail wag".
    -# Therefore, the following method returns "Joy".
    -fido wag

    +# The invocation of "fido wag" is delegated to "fido::tail wag". +# Therefore, the following method returns "Joy". +fido wag

    Listing 23 again extends the example by adding a forwarder named wag to the object (e.g. fido). The forwarder redirects all calls of the form fido wag with arbitrary arguments to @@ -2133,32 +1853,19 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    -
    nx::Class create Dog {
    +
    nx::Class create Dog {
       :public method bark {} { puts "[self] Bark, bark, bark." }
     
    -  # Define a public alias for the method "bark"
    +  # Define a public alias for the method "bark"
       :public alias warn [:info method handle bark]
    -  # ...
    +  # ...
     }
     
    -# Create an instance of the class
    +# Create an instance of the class
     Dog create fido
     
    -# The following line prints "::fido Bark, bark, bark."
    -fido warn

    +# The following line prints "::fido Bark, bark, bark." +fido warn

    Listing 24 extends the last example by defining an alias for the method bark. The example only shows the bare mechanism. In general, method aliases are very powerful means for @@ -2206,50 +1913,28 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    -
    nx::Class create Foo {
    +
    nx::Class create Foo {
     
    -  # Define a public method
    +  # Define a public method
       :public method foo {} {
    -    # ....
    +    # ....
         return [:helper]
       }
     
    -  # Define a protected method
    +  # Define a protected method
       :method helper {} {
          return 1
       }
     }
     
    -# Create an instance of the class:
    +# Create an instance of the class:
     Foo create f1
     
    -# The invocation of the public method "foo" returns 1
    +# The invocation of the public method "foo" returns 1
     f1 foo
     
    -# The invocation of the protected method "helper" raises an error:
    -f1 helper

    +# The invocation of the protected method "helper" raises an error: +f1 helper

    The example above uses :protected method helper …. We could have used here as well :method helper …, since the default method call-protection is already protected.

    @@ -2269,34 +1954,20 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    -
    nx::Class create Base {
    -  :private method helper {a b} {expr {$a + $b}}
    -  :public method foo     {a b} {: -local helper $a $b}
    +
    nx::Class create Base {
    +  :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}}
    +  :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
    -s1 bar 3 4     ;# returns 12
    -s1 helper 3 4  ;# raises error: unable to dispatch method helper
    +s1 foo 3 4 ;# returns 7 +s1 bar 3 4 ;# returns 12 +s1 helper 3 4 ;# raises error: unable to dispatch method helper

    The base class implements a public method foo using the helper method named helper. The derived class implements a as well a public method bar, which is also using a helper method named helper. When @@ -2335,56 +2006,31 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    -
    #
    -# Define a class C with a property "x" and a public accessor
    -#
    +
    #
    +# Define a class C with a property "x" and a public accessor
    +#
     nx::Class create C {
       :property -accessor public {x c}
     }
     
    -#
    -# Define a subclass D with a private property "x"
    -# and a method bar, which is capable of accessing
    -# the private property.
    -#
    +#
    +# Define a subclass D with a private property "x"
    +# and a method bar, which is capable of accessing
    +# the private property.
    +#
     nx::Class create D -superclass C {
       :property -accessor private {x d}
    -  :public method bar {p} {return [: -local $p get]}
    +  :public method bar {p} {return [: -local $p get]}
     }
     
    -#
    -# The private and public (or protected) properties
    -# define internally separate variable that do not
    -# conflict.
    -#
    +#
    +# The private and public (or protected) properties
    +# define internally separate variable that do not
    +# conflict.
    +#
     D create d1
    -puts [d1 x get]   ;# prints "c"
    -puts [d1 bar x]   ;# prints "d"

    +puts [d1 x get] ;# prints "c" +puts [d1 bar x] ;# prints "d"

    Without the private definition of the property, the definition of property x in class D would shadow the definition of the property in the superclass C for its instances @@ -2417,22 +2063,14 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -
    nx::Class create C {
    +
    nx::Class create C {
       :public method foo {} {return 1}
       :create c1
     }
     
    -# Method "foo" is defined on class "C"
    -# and applicable to the instances of "C"
    -c1 foo

    +# Method "foo" is defined on class "C" +# and applicable to the instances of "C" +c1 foo

    There are many programming languages that only allow these types of methods. However, NX also allows methods to be defined on objects.

    @@ -2462,44 +2100,25 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    -
    nx::Class create C {
    +
    nx::Class create C {
       :public method foo {} {return 1}
       :create c1 {
          :public object method foo {} {return 2}
          :public object method bar {} {return 3}
       }
     }
     
    -# Method "bar" is an object specific method of "c1"
    +# Method "bar" is an object specific method of "c1"
     c1 bar
     
    -# object-specific method "foo" returns 2
    +# object-specific method "foo" returns 2
     c1 foo
     
    -# Method "baz" is an object specific method of "o1"
    +# Method "baz" is an object specific method of "o1"
     nx::Object create o1 {
       :public object method baz {} {return 4}
     }
    -o1 baz
    +o1 baz

    3.4.3. Class Methods

    @@ -2529,56 +2148,31 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    -
    nx::Class create C {
    -  #
    -  # Define a class method "bar" and an instance
    -  # method "foo"
    -  #
    +
    nx::Class create C {
    +  #
    +  # Define a class method "bar" and an instance
    +  # method "foo"
    +  #
       :public object method bar {} {return 2}
       :public method foo {} {return 1}
     
    -  #
    -  # Create an instance of the current class
    -  #
    +  #
    +  # Create an instance of the current class
    +  #
       :create c1
     }
     
    -# Method "bar" is a class method of class "C"
    -# therefore applicable on the class object "C"
    +# Method "bar" is a class method of class "C"
    +# therefore applicable on the class object "C"
     C bar
     
    -# Method "foo" is an instance method of "C"
    -# therefore applicable on instance "c1"
    +# Method "foo" is an instance method of "C"
    +# therefore applicable on instance "c1"
     c1 foo
     
    -# When trying to invoke the class method on the
    -# instance, an error will be raised.
    -c1 bar
    +# When trying to invoke the class method on the +# instance, an error will be raised. +c1 bar

    In some other object oriented programming languages, class methods are called "static methods".

    @@ -2614,34 +2208,20 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    -
    nx::Class create C {
    +
    nx::Class create C {
     
    -    # Define an ensemble method "string" with sub-methods
    -    # "length", "tolower" and "info"
    +    # 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} {...}
    -    #...
    +    #...
         :create c1
     }
     
    -# Invoke the ensemble method
    -c1 string length "hello world"
    +# Invoke the ensemble method +c1 string length "hello world"

    3.6. Method Resolution

    @@ -2665,33 +2245,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    -
    nx::Class create C {
    +
    nx::Class create C {
       :public method foo {} {
         return "C foo: [next]"
       }
    @@ -2710,13 +2264,13 @@
        }
     }
     
    -# Invoke the method foo
    +# Invoke the method foo
     d1 foo
    -# result: "d1 foo: D foo: C foo: "
    +# result: "d1 foo: D foo: C foo: "
     
    -# Query the precedence order from NX via introspection
    +# Query the precedence order from NX via introspection
     d1 info precedence
    -# result: "::D ::C ::nx::Object"
    +# result: "::D ::C ::nx::Object"

    Consider the example in Listing 32. When the method foo is invoked on object d1, the object method has the highest @@ -2744,54 +2298,30 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    -
    nx::Class create M1 {
    +
    nx::Class create M1 {
       :public method foo {} { return "M1 foo: [next]"}
     }
     nx::Class create M2 {
       :public method foo {} { return "M2 foo: [next]"}
     }
     
    -#
    -# "d1" is created based on the definitions of the last example
    -#
    -# Add the methods from "M1" as per-object mixin to "d1"
    +#
    +# "d1" is created based on the definitions of the last example
    +#
    +# Add the methods from "M1" as per-object mixin to "d1"
     d1 object mixins add M1
     
    -#
    -# Add the methods from "M2" as per-class mixin to class "C"
    +#
    +# Add the methods from "M2" as per-class mixin to class "C"
     C mixins add M2
     
    -# Invoke the method foo
    +# Invoke the method foo
     d1 foo
    -# result: "M1 foo: M2 foo: d1 foo: D foo: C foo: "
    +# result: "M1 foo: M2 foo: d1 foo: D foo: C foo: "
     
    -# Query the precedence order from NX via introspection
    +# Query the precedence order from NX via introspection
     d1 info precedence
    -# result: "::M1 ::M2 ::D ::C ::nx::Object"

    +# result: "::M1 ::M2 ::D ::C ::nx::Object"

    The example in Listing 33 is an extension of the previous example. We define here two additional classes M1 and M2 which are used as per-object and per-class @@ -2811,38 +2341,22 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    -
    #
    -# "d1" is created based on the definitions of the last two examples,
    -# the mixins "M1" and "M2" are registered.
    -#
    -# Define a public object method "bar", which calls the method
    -# "foo" which various invocation options:
    -#
    +
    #
    +# "d1" is created based on the definitions of the last two examples,
    +# the mixins "M1" and "M2" are registered.
    +#
    +# Define a public object method "bar", which calls the method
    +# "foo" which various invocation options:
    +#
     d1 public object method bar {} {
        puts [:foo]
        puts [: -local foo]
        puts [: -intrinsic foo]
        puts [: -system foo]
     }
     
    -# Invoke the method "bar"
    -d1 bar

    +# Invoke the method "bar" +d1 bar

    In the first line of the body of method bar, the method foo is called as usual with an implicit receiver, which defaults to the current object (therefore, the call is equivalent to d1 foo). The @@ -2935,78 +2449,42 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    - 27
    - 28
    - 29
    - 30
    - 31
    - 32
    - 33
    - 34
    - 35
    - 36
    -
    nx::Object create o1 {
    +
    nx::Object create o1 {
     
    -  #
    -  # Method foo has positional parameters:
    -  #
    +  #
    +  # Method foo has positional parameters:
    +  #
       :public object method foo {x y} {
         puts "x=$x y=$y"
       }
     
    -  #
    -  # Method bar has non-positional parameters:
    -  #
    +  #
    +  # Method bar has non-positional parameters:
    +  #
       :public object method bar {-x -y} {
         puts "x=$x y=$y"
       }
     
    -  #
    -  # Method baz has non-positional and
    -  # positional parameters:
    -  #
    +  #
    +  # Method baz has non-positional and
    +  # positional parameters:
    +  #
       :public object method baz {-x -y a} {
         puts "x? [info exists x] y? [info exists y] a=$a"
       }
     }
     
    -# invoke foo (positional parameters)
    +# invoke foo (positional parameters)
     o1 foo 1 2
     
    -# invoke bar (non-positional parameters)
    +# invoke bar (non-positional parameters)
     o1 bar -y 3 -x 1
     o1 bar -x 1 -y 3
     
    -# invoke baz (positional and non-positional parameters)
    +# invoke baz (positional and non-positional parameters)
     o1 baz -x 1 100
     o1 baz 200
    -o1 baz -- -y

    +o1 baz -- -y

    Consider the example in Listing 35. The method foo has the argument list x y. This means that the first argument is passed in an invocation like o1 foo 1 2 to x (here, the value @@ -3052,48 +2530,27 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    -
    nx::Object create o2 {
    +
    nx::Object create o2 {
     
    -  #
    -  # Method foo has one required and one optional
    -  # positional parameter:
    -  #
    +  #
    +  # Method foo has one required and one optional
    +  # positional parameter:
    +  #
       :public object method foo {x:required y:optional} {
         puts "x=$x y? [info exists y]"
       }
     
    -  #
    -  # Method bar has one required and one optional
    -  # non-positional parameter:
    -  #
    +  #
    +  # Method bar has one required and one optional
    +  # non-positional parameter:
    +  #
       :public object method bar {-x:required -y:optional} {
         puts "x=$x y? [info exists y]"
       }
     }
     
    -# invoke foo (one optional positional parameter is missing)
    -o2 foo 1

    +# invoke foo (one optional positional parameter is missing) +o2 foo 1

    The example in Listing 36 defined method foo with one required and one optional positional parameter. For this purpose we use the parameter options required and optional. The @@ -3131,46 +2588,26 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    -
    nx::Object create o3 {
    +
    nx::Object create o3 {
     
    -  #
    -  # Positional parameter with default value:
    -  #
    +  #
    +  # Positional parameter with default value:
    +  #
       :public object method foo {{x 1} {y 2}} {
         puts "x=$x y=$y"
       }
     
    -  #
    -  # Non-positional parameter with default value:
    -  #
    +  #
    +  # Non-positional parameter with default value:
    +  #
       :public object method bar {{-x 10} {-y 20}} {
         puts "x=$x y=$y"
       }
     }
     
    -# use default values
    +# use default values
     o3 foo
    -o3 bar

    +o3 bar

    In order to define a default value for a parameter, the parameter specification must be of the form of a 2 element list, where the second argument is the default value. See for an example in @@ -3221,46 +2658,26 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    -
    nx::Object create o4 {
    +
    nx::Object create o4 {
     
    -  #
    -  # Positional parameter with value constraints:
    -  #
    +  #
    +  # Positional parameter with value constraints:
    +  #
       :public object method foo {x:integer o:object,optional} {
         puts "x=$x o? [info exists o]"
       }
     
    -  #
    -  # Non-positional parameter with value constraints:
    -  #
    +  #
    +  # Non-positional parameter with value constraints:
    +  #
       :public object method bar {{-x:integer 10} {-verbose:boolean false}} {
         puts "x=$x verbose=$verbose"
       }
     }
     
    -# The following invocation raises an exception, since the
    -# value "a" for parameter "x" is not an integer
    -o4 foo a

    +# The following invocation raises an exception, since the +# value "a" for parameter "x" is not an integer +o4 foo a

    Value contraints are specified as parameter options in the parameter specifications. The parameter specification x:integer defines x as a required positional parmeter which value is constraint to an @@ -3282,62 +2699,34 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    - 27
    - 28
    -
    #
    -# Create classes for Person and Project
    -#
    +
    #
    +# Create classes for Person and Project
    +#
     nx::Class create Person
     nx::Class create Project
     
     nx::Object create o5 {
    -  #
    -  # Parameterized value constraints
    -  #
    +  #
    +  # Parameterized value constraints
    +  #
       :public object method work {
          -person:object,type=Person
          -project:object,type=Project
        } {
    -    # ...
    +    # ...
       }
     }
     
    -#
    -# Create a Person and a Project instance
    -#
    +#
    +# Create a Person and a Project instance
    +#
     Person create gustaf
     Project create nx
     
    -#
    -# Use method with value constraints
    -#
    -o5 work -person gustaf -project nx

    +# +# Use method with value constraints +# +o5 work -person gustaf -project nx

    The native checkers object, class, metaclass and baseclass can be further specialized with the parameter option type to restrict the permissible values to instances of certain classes. We can use for @@ -3371,92 +2760,49 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    - 27
    - 28
    - 29
    - 30
    - 31
    - 32
    - 33
    - 34
    - 35
    - 36
    - 37
    - 38
    - 39
    - 40
    - 41
    - 42
    - 43
    -
    #
    -# Value checker named "groupsize"
    -#
    +
    #
    +# Value checker named "groupsize"
    +#
     ::nx::Slot method type=groupsize {name value} {
    -  if {$value < 1 || $value > 6} {
    +  if {$value < 1 || $value > 6} {
         error "Value '$value' of parameter $name is not between 1 and 6"
       }
     }
     
    -#
    -# Value checker named "choice" with extra argument
    -#
    +#
    +# Value checker named "choice" with extra argument
    +#
     ::nx::Slot method type=choice {name value arg} {
    -  if {$value ni [split $arg |]} {
    +  if {$value ni [split $arg |]} {
         error "Value '$value' of parameter $name not in permissible values $arg"
       }
     }
     
    -#
    -# Create an application class D
    -# using the new value checkers
    -#
    +#
    +# Create an application class D
    +# using the new value checkers
    +#
     nx::Class create D {
       :public method foo {a:groupsize} {
    -    # ...
    +    # ...
       }
       :public method bar {a:choice,arg=red|yellow|green b:choice,arg=good|bad} {
    -    # ...
    +    # ...
       }
     }
     
     D create d1
     
    -# testing "groupsize";
    -# the second call (with value 10) will raise an exception:
    +# testing "groupsize";
    +# the second call (with value 10) will raise an exception:
     d1 foo 2
     d1 foo 10
     
    -# testing "choice"
    -# the second call (with value pink for parameter a)
    -# will raise an exception:
    +# testing "choice"
    +# the second call (with value pink for parameter a)
    +# will raise an exception:
     d1 bar green good
    -d1 bar pink bad

    +d1 bar pink bad

    In order to define a checker groupsize a method of the name type=groupsize is defined. This method receives two arguments, name and value. The first argument is the name of the parameter @@ -3514,58 +2860,32 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    -
    nx::Object create o6 {
    +
    nx::Object create o6 {
     
    -  #
    -  # Positional parameter with an possibly empty
    -  # single value
    -  #
    +  #
    +  # Positional parameter with an possibly empty
    +  # single value
    +  #
       :public object method foo {x:integer,0..1} {
         puts "x=$x"
       }
     
    -  #
    -  # Positional parameter with an possibly empty
    -  # list of values value
    -  #
    +  #
    +  # Positional parameter with an possibly empty
    +  # list of values value
    +  #
       :public object method bar {x:integer,0..n} {
         puts "x=$x"
       }
     
    -  #
    -  # Positional parameter with a non-empty
    -  # list of values
    -  #
    +  #
    +  # Positional parameter with a non-empty
    +  # list of values
    +  #
       :public object method baz {x:integer,1..n} {
         puts "x=$x"
       }
    -}

    +}

    Listing 42 contains three examples for positional parameters with different multiplicities. Multiplicity is often combined with value constraints. A parameter specification of @@ -3654,60 +2974,33 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    - 27
    -
    #
    -# Define a class Person with properties "name"
    -# and "birthday"
    -#
    +
    #
    +# Define a class Person with properties "name"
    +# and "birthday"
    +#
     nx::Class create Person {
       :property name:required
       :property birthday
     }
     
    -#
    -# Define a class Student as specialization of Person
    -# with and additional property
    -#
    +#
    +# 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}
     }
     
    -#
    -# Create instances using configure parameters
    -# for the initialization
    -#
    +#
    +# Create instances using configure parameters
    +# for the initialization
    +#
     Person create p1 -name Bob
     Student create s1 -name Susan -matnr 4711
     
    -# Access property value via "cget" method
    -puts "The name of s1 is [s1 cget -name]"

    +# Access property value via "cget" method +puts "The name of s1 is [s1 cget -name]"

    The class Person has two properties name and birthday, where the property name is required, the property birthday is not. The class Student is a subclass of Person with the additional required @@ -3764,21 +3057,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    -
    Configure parameters for Person p1:
    +
    Configure parameters for Person p1:
        Command:
           p1 info lookup syntax configure
        Result:
    @@ -3791,7 +3070,7 @@
        Result:
           ?-oncampus /boolean/? -matnr /value/ -name /value/
           ?-birthday /value/? ?-object-mixins /mixinreg .../? ?-class /class/?
    -      ?-object-filters /filterreg .../? ?/__initblock/?

    + ?-object-filters /filterreg .../? ?/__initblock/?

    The given paramter show, how (a) objects can be configured at runtime or (b) how new instances can be configured at creation time via the new or create methods. @@ -3848,20 +3127,13 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -
    Configure parameter for class nx::Class
    +
    Configure parameter for class nx::Class
        Command:
           nx::Class info lookup syntax configure
        Result:
           ?-superclass /class .../? ?-mixins /mixinreg .../?
           ?-filters /filterreg .../? ?-object-mixins /mixinreg .../?
    -      ?-class /class/? ?-object-filters /filterreg .../? ?/__initblock/?

    + ?-class /class/? ?-object-filters /filterreg .../? ?/__initblock/?

    4.3.3. User defined Parameter Types

    @@ -3962,26 +3234,16 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    -
    ::nx::Object create o {
    +
    ::nx::Object create o {
       :object method unknown {called_method args} {
         puts "Unknown method '$called_method' called"
       }
     }
     
    -# Invoke an unknown method for object o:
    +# Invoke an unknown method for object o:
     o foo 1 2 3
     
    -# Output will be: "Unknown method 'foo' called"
    +# Output will be: "Unknown method 'foo' called"

    Without any provision of an unknown method handler, an error will be raised, when an unknown method is called.

    @@ -4006,50 +3268,28 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    -
    ::nx::Class public object method __unknown {name} {
    -  # A very simple unknown handler, showing just how
    -  # the mechanism works.
    +
    ::nx::Class public object 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
    +# Register an unknown handler as a method of ::nx::Class
     ::nsf::object::unknown::add nx {::nx::Class __unknown}
     
     ::nx::Object create o {
    -  # The class M is unknown at this point
    +  # The class M is unknown at this point
     
       :object mixins add M
    -  # The line above has triggered the unknown class handler,
    -  # class M is now defined
    +  # The line above has triggered the unknown class handler,
    +  # class M is now defined
     
       puts [:info object mixins]
    -  # The output will be:
    -  #     ***** __unknown called with <::M>
    -  #     ::M
    -}
    + # The output will be: + # ***** __unknown called with <::M> + # ::M +}

    The Next Scripting Framework allows to add, query, delete and list unknown handlers.

    Listing 50: Unknown Handler registration

    @@ -4063,16 +3303,11 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
      1
    -  2
    -  3
    -  4
    -  5
    -
    # Interface for unknown handlers:
    -# nsf::object::unknown::add /key/ /handler/
    -# nsf::object::unknown::get /key/
    -# nsf::object::unknown::delete /key/
    -# nsf::object::unknown::keys
    +
    # Interface for unknown handlers:
    +# nsf::object::unknown::add /key/ /handler/
    +# nsf::object::unknown::get /key/
    +# nsf::object::unknown::delete /key/
    +# nsf::object::unknown::keys
    References