Index: TODO =================================================================== diff -u -rb5b08b9cc2fea92762787311da318d49d77d2a7b -rd168a26bce713de8daa5bbe79d740926e961c5bc --- TODO (.../TODO) (revision b5b08b9cc2fea92762787311da318d49d77d2a7b) +++ TODO (.../TODO) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -1339,9 +1339,10 @@ - fixed handles with subcommands for class methods when called on classes or objects - extended regression test -TODO: -- check potential crashes with invalid input +- changed "cls object method ..." and friends into + "cls class-object method ..." and friends into +TODO: - check equivalence of the following two commands in respect to fully-qualified names ::nsf::dispatch $obj ::nsf::cmd::ObjectInfo2::hastype $class @@ -1352,9 +1353,7 @@ * handle introspection for subcmd nicely * handle absence of -create flag in resolve_method_path (for introspection) * consider alternate method name/place for subcmds on classes - - currently, "info slotobjects" returns only instances of ::nx::Slot - (the logic is scripted, otherwise, we would have to hardcode the name - nx::Slot). + - currently, there are potentail conflicts between slots and ensemble objects - provide a different place in the namesspaces could simplify this - aliases on procs are a problem, when upvar is used (see info default/instdefault in xotcl2.tcl) Index: doc/next-migration.html =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- doc/next-migration.html (.../next-migration.html) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ doc/next-migration.html (.../next-migration.html) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -228,15 +228,15 @@ C proc bar args {...}
- # Define method and object method
# in the init-block of a class


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


Class create C {
  :method foo args {...}
-   :object method bar args {...}
+   :class-object method bar args {...}
}

- # Define method and object method with separate calls

+ # Define method and class-object method with separate calls

Class create C
C method foo args {...}
- C object method bar args {...}
+ C class-object method bar args {...}
@@ -245,13 +245,13 @@ o proc foo args {...}
- # Define object method and set instance variable
+ # Define class-object method and set instance variable
# in the init-block of an object


Object create o {
  set :x 1
  :method foo args {...}
}

- # Define object method and set instance variable
+ # Define class-object method and set instance variable
# with separate commands


Object create o
o eval {set :x 1}

@@ -303,7 +303,7 @@ # Define scripted methods

Class create C {
  :method foo args {...}
-   :object method bar args {...}
+   :class-object method bar args {...}
}

Object create o {
  :method baz args {...}
@@ -324,7 +324,7 @@ # Define forwarder

Class create C {
  :forward f1 ...
-   :object forward f2 ...
+   :class-object forward f2 ...
}

Object create o {
  :forward f3 ...
@@ -345,7 +345,7 @@ # Define setter and getter methods

Class create C {
  :setter p1 ?value_constraint?
-   :object setter p2 ?value_constraint?
+   :class-object setter p2 ?value_constraint?
}

Object create o {
  :setter p3 ?value_constraint?
@@ -362,7 +362,7 @@ ># (to scripted or non-scripted methods)


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

Object create o {
  :alias a3 ...
@@ -384,7 +384,7 @@ Class create C {
  :attribute x
  :attribute {y 1}
-   :object attribute oa1
+   :class-object attribute oa1
}

Object create o {
  :attribute oa2
@@ -417,7 +417,7 @@   :method-definiton-method ...
  :public method-definiton-method ...
  :protected method-definiton-method ...
-   :object method-definiton-method ...
+   :class-object method-definiton-method ...
  :protected object method-definiton-method ...
  :public object method-definiton-method ...
}
@@ -795,8 +795,8 @@ # Register per-object mixin and guard for a class

- cls object mixin ...
- cls object mixin guard mixin condition
+ cls class-object mixin ...
+ cls class-object mixin guard mixin condition
@@ -833,8 +833,8 @@ # Register per-object filter and guard for a class

- cls object filter ...
- cls object filter guard filter condition
+ cls class-object filter ...
+ cls class-object filter guard filter condition
@@ -923,31 +923,31 @@ - + - + - + - + - + - + - +
cls info commands ?pattern?cls object info methods ?pattern?cls class-object info methods ?pattern?
cls info parametercmd ?pattern?cls object info methods -methodtype setter ?pattern?cls class-object info methods -methodtype setter ?pattern?
cls info procs ?pattern?cls object info methods -methodtype scripted ?pattern?cls class-object info methods -methodtype scripted ?pattern?
n.a.cls object info methods -methodtype alias ?pattern?cls class-object info methods -methodtype alias ?pattern?
n.a.cls object info methods -methodtype forwarder ?pattern?cls class-object info methods -methodtype forwarder ?pattern?
n.a.cls object info methods -methodtype object ?pattern?cls class-object info methods -methodtype object ?pattern?
n.a.cls object info methods -callprotection public|protected ...cls class-object info methods -callprotection public|protected ...
@@ -1100,13 +1100,13 @@ cls info filter ?-guards? ?-order? ?pattern? - cls object info filter methods ?-guards? ?-order? ?pattern? + cls class-object info filter methods ?-guards? ?-order? ?pattern? cls info filterguard name - cls object info filter guard name + cls class-object info filter guard name @@ -1132,13 +1132,13 @@ cls info mixin ?-guards? ?-order? ?pattern? - cls object info mixin classes ?-guards? ?-order? ?pattern? + cls class-object info mixin classes ?-guards? ?-order? ?pattern? cls info mixinguard name - cls object info mixin guard name + cls class-object info mixin guard name Index: doc/tutorial2.html =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- doc/tutorial2.html (.../tutorial2.html) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ doc/tutorial2.html (.../tutorial2.html) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -507,7 +507,7 @@ Class create Stack { # ... - :object method available_stacks {} { + :class-object method available_stacks {} { return [llength [:info instances]] } } @@ -1436,7 +1436,7 @@

Resembling to objects, information on classes may be gained through the info instance method of the meta-class Class. Note that this instance method does not -only support the class info options, but also the object info options, +only support the class info options, but also the class-object info options, since the accessing command refers to the class-object, which itself is an object and, therefore, offers its informations. The following table summarizes the additional info options available on classes. @@ -2649,7 +2649,7 @@

Introspection on Filters

In order to gain information about the currently registered filters on -a certain object/class, the object info option filters and +a certain object/class, the class-object info option filters and the class info option instfilters may be queried. It returns a list of the currently registered filters:

@@ -2828,7 +2828,7 @@ since the additions may produce other additions as side-effects. This demonstrates clearly that the sub-class mechanism provides only a poor mechanism for mix-in of orthogonal functionality. Therefore we -provide an extension in the form of object mixin classes, which are +provide an extension in the form of class-object mixin classes, which are added in front of the search precedence of classes.

Per-Object Mixins @@ -2910,7 +2910,7 @@

It returns the list of all mix-ins of the object, if pattern -is not specified, otherwise it returns the matching per object mixin classes. +is not specified, otherwise it returns the matching per class-object mixin classes.

The inverse operation of info mixin is mixinof finds Index: generic/nsf.c =================================================================== diff -u -rb5b08b9cc2fea92762787311da318d49d77d2a7b -rd168a26bce713de8daa5bbe79d740926e961c5bc --- generic/nsf.c (.../nsf.c) (revision b5b08b9cc2fea92762787311da318d49d77d2a7b) +++ generic/nsf.c (.../nsf.c) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -10561,7 +10561,7 @@ int withObjscope, int withPer_object) { Tcl_ListObjAppendElement(interp, listObj, object->cmdName); if (withPer_object) { - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("object", 6)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("class-object", 12)); } Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(registerCmdName, -1)); if (withObjscope) { Index: library/lib/doc-tools.tcl =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -437,7 +437,7 @@ Class create ContainerEntity -superclass StructuredEntity { Class create [current]::Resolvable { - :object attribute container:object,type=[:info parent] + :class-object attribute container:object,type=[:info parent] :method get_fully_qualified_name {name} { set container [[current class] container] if {![string match "::*" $name]} { @@ -452,7 +452,7 @@ Class create [current]::Containable { # TODO: check the interaction of required, per-object attribute and ::nsf::assertion #:object attribute container:object,type=[:info parent],required - :object attribute container:object,type=[:info parent] + :class-object attribute container:object,type=[:info parent] :method create args { # # Note: preserve the container currently set at this callstack @@ -502,7 +502,7 @@ QualifierTag mixin add [current class]::Resolvable [current class]::Resolvable container [current] QualifierTag mixin add [current class]::Containable - @package object mixin add [current class]::Containable + @package class-object mixin add [current class]::Containable [current class]::Containable container [current] } @@ -714,7 +714,7 @@ set :part_class @param } - :object method new { + :class-object method new { -part_attribute:required -partof:object,type=::nx::doc::Entity -name @@ -869,11 +869,11 @@ :attribute default - :object method id {partof_name scope name} { + :class-object method id {partof_name scope name} { next [:get_unqualified_name ${partof_name}] $scope $name } - # :object method id {partof_name name} { + # :class-object method id {partof_name name} { # # The method contains the parameter-specific name production rules. # # # # @param partof Refers to the entity object which contains this part @@ -893,7 +893,7 @@ # @param -partof # @param -name # @param args - :object method new { + :class-object method new { -part_attribute -partof:required -name @@ -1779,7 +1779,7 @@ } :attribute current_entity:object - :object method process { + :class-object method process { {-partof_entity ""} {-initial_section context} {-parsing_level 0} Index: library/lib/make.tcl =================================================================== diff -u -r98465e73caeb8fab996488d96fedbd99a13f2370 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- library/lib/make.tcl (.../make.tcl) (revision 98465e73caeb8fab996488d96fedbd99a13f2370) +++ library/lib/make.tcl (.../make.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -137,7 +137,7 @@ if {$argv eq "-n"} {set argv "-n -all"} Class create Script { - :object method create args { + :class-object method create args { lappend args {*}$::argv set s [next] set method [list] Index: library/lib/test.tcl =================================================================== diff -u -rf93a860bacabe371e1f01bd3f3841015c6b14a21 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- library/lib/test.tcl (.../test.tcl) (revision f93a860bacabe371e1f01bd3f3841015c6b14a21) +++ library/lib/test.tcl (.../test.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -34,7 +34,7 @@ set :count 0 - :public object method case {name arg:optional} { + :public class-object method case {name arg:optional} { # # Experimental version of Test case, which (1) accepts test case as argument # and (2) destroys all created objects on exit (auto cleanup) @@ -58,7 +58,7 @@ } } - :public object method parameter {name value:optional} { + :public class-object method parameter {name value:optional} { if {[info exists value]} { #[[current] slot $name] default $value #:slot $name default $value @@ -69,7 +69,7 @@ } } - :public object method new args { + :public class-object method new args { set testfile [file rootname [file tail [info script]]] if {[info exists :case]} { if {![info exists :ccount(${:case})]} {set :ccount(${:case}) 0} @@ -80,7 +80,7 @@ :create ${:name} -name ${:name} {*}$args } - :public object method run {} { + :public class-object method run {} { set startTime [clock clicks -milliseconds] foreach example [lsort [:info instances -closure]] { $example run Index: library/nx/nx.tcl =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- library/nx/nx.tcl (.../nx.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ library/nx/nx.tcl (.../nx.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -165,7 +165,7 @@ Class eval { # method-modifier for object specific methos - :method object {what args} { + :method class-object {what args} { if {$what in [list "alias" "attribute" "forward" "method" "setter"]} { return [::nsf::dispatch [::nsf::current object] ::nsf::classes::nx::Object::$what {*}$args] } @@ -258,7 +258,7 @@ # tries to resolve the class again. This meachnism is used e.g. by # the ::ttrace mechanism for partial loading by Zoran. # - Class protected object method __unknown {name} {} + Class protected class-object method __unknown {name} {} # Add alias methods. cmdName for a method can be added via # [... info method handle ] @@ -296,7 +296,7 @@ # Object method require {what args} { switch -- $what { - object { + class-object { set what [lindex $args 0] if {$what eq "method"} { ::nsf::require_method [::nsf::current object] [lindex $args 1] 1 Index: library/serialize/serializer.tcl =================================================================== diff -u -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- library/serialize/serializer.tcl (.../serializer.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -301,7 +301,7 @@ # class object specfic methods ############################### - :object method allChildren o { + :class-object method allChildren o { # return o and all its children fully qualified set set [::nsf::dispatch $o -objscope ::nsf::current] foreach c [$o info children] { @@ -310,21 +310,21 @@ return $set } - :object method exportMethods list { + :class-object method exportMethods list { foreach {o p m} $list {set :exportMethods([list $o $p $m]) 1} } - :object method exportObjects list { + :class-object method exportObjects list { foreach o $list {set :exportObjects($o) 1} } - :object method exportedMethods {} {array names :exportMethods} - :object method exportedObjects {} {array names :exportObjects} + :class-object method exportedMethods {} {array names :exportMethods} + :class-object method exportedObjects {} {array names :exportObjects} - :object method resetPattern {} {array unset :ignorePattern} - :object method addPattern {p} {set :ignorePattern($p) 1} + :class-object method resetPattern {} {array unset :ignorePattern} + :class-object method addPattern {p} {set :ignorePattern($p) 1} - :object method checkExportedMethods {} { + :class-object method checkExportedMethods {} { foreach k [array names :exportMethods] { foreach {o p m} $k break set ok 0 @@ -340,7 +340,7 @@ } } - :object method checkExportedObject {} { + :class-object method checkExportedObject {} { foreach o [array names :exportObjects] { if {![::nsf::isobject $o]} { puts stderr "Serializer exportObject: ignore non-existing object $o" @@ -354,7 +354,7 @@ } } - :object method all {-ignoreVarsRE -ignore} { + :class-object method all {-ignoreVarsRE -ignore} { # don't filter anything during serialization set filterstate [::nsf::configure filter off] @@ -397,12 +397,12 @@ return $r } - :object method methodSerialize {object method prefix} { + :class-object method methodSerialize {object method prefix} { set s [:new -childof [::nsf::current object] -volatile] concat $object [$s method-serialize $object $method $prefix] } - :object method deepSerialize {-ignoreVarsRE -ignore -map args} { + :class-object method deepSerialize {-ignoreVarsRE -ignore -map args} { :resetPattern set s [:new -childof [::nsf::current object] -volatile] if {[info exists ignoreVarsRE]} {$s ignoreVarsRE $ignoreVarsRE} Index: library/xotcl/doc/tutorial.html =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- library/xotcl/doc/tutorial.html (.../tutorial.html) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ library/xotcl/doc/tutorial.html (.../tutorial.html) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -1337,7 +1337,7 @@

Resembling to objects, information on classes may be gained through the info instance method of the meta-class Class. Note that this instance method does not -only support the class info options, but also the object info options, +only support the class info options, but also the class-object info options, since the accessing command refers to the class-object, which itself is an object and, therefore, offers its informations. The following table summarizes the additional info options available on classes. @@ -2550,7 +2550,7 @@

Introspection on Filters

In order to gain information about the currently registered filters on -a certain object/class, the object info option filters and +a certain object/class, the class-object info option filters and the class info option instfilters may be queried. It returns a list of the currently registered filters:

@@ -2729,7 +2729,7 @@ since the additions may produce other additions as side-effects. This demonstrates clearly that the sub-class mechanism provides only a poor mechanism for mix-in of orthogonal functionality. Therefore we -provide an extension in the form of object mixin classes, which are +provide an extension in the form of class-object mixin classes, which are added in front of the search precedence of classes.

Per-Object Mixins @@ -2811,7 +2811,7 @@

It returns the list of all mix-ins of the object, if pattern -is not specified, otherwise it returns the matching per object mixin classes. +is not specified, otherwise it returns the matching per class-object mixin classes.

The inverse operation of info mixin is mixinof finds Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -849,18 +849,18 @@ {export {}} } { - :public object method create {name args} { + :public class-object method create {name args} { set nq [namespace qualifiers $name] if {$nq ne "" && ![namespace exists $nq]} {Object create $nq} next } - :public object method extend {name args} { + :public class-object method extend {name args} { :require $name $name configure {*}$args } - :public object method contains script { + :public class-object method contains script { if {[info exists :provide]} { package provide [set :provide] [set :version] } else { @@ -881,16 +881,16 @@ } } - :public object method unknown args { + :public class-object method unknown args { #puts stderr "unknown: package $args" [set :packagecmd] {*}$args } - :public object method verbose value { + :public class-object method verbose value { set :verbose $value } - :public object method present args { + :public class-object method present args { if {$::tcl_version<8.3} { switch -exact -- [lindex $args 0] { -exact {set pkg [lindex $args 1]} @@ -906,7 +906,7 @@ } } - :public object method import {{-into ::} pkg} { + :public class-object method import {{-into ::} pkg} { :require $pkg namespace eval $into [subst -nocommands { #puts stderr "*** package import ${pkg}::* into [namespace current]" @@ -921,7 +921,7 @@ } } - :public object method require args { + :public class-object method require args { #puts "XOTCL package require $args, current=[namespace current]" set prevComponent ${:component} if {[catch {set v [package present {*}$args]} msg]} { Index: tests/aliastest.tcl =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/aliastest.tcl (.../aliastest.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ tests/aliastest.tcl (.../aliastest.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -104,63 +104,63 @@ ? {T info methods} {} T method foo args { return [current class]->[current method] } - T object method bar args { return [current class]->[current method] } + T class-object method bar args { return [current class]->[current method] } ::nsf::alias T -per-object FOO ::nsf::classes::T::foo ::nsf::alias T -per-object BAR ::T::FOO ::nsf::alias T -per-object ZAP ::T::BAR ? {T info methods} {foo} - ? {lsort [T object info methods -methodtype alias]} {BAR FOO ZAP} - ? {lsort [T object info methods]} {BAR FOO ZAP bar} + ? {lsort [T class-object info methods -methodtype alias]} {BAR FOO ZAP} + ? {lsort [T class-object info methods]} {BAR FOO ZAP bar} ? {t foo} ::T->foo - ? {T object info method definition ZAP} {::T object alias ZAP ::T::BAR} + ? {T class-object info method definition ZAP} {::T class-object alias ZAP ::T::BAR} ? {T FOO} ->foo ? {T BAR} ->foo ? {T ZAP} ->foo ? {T bar} ->bar - T object method FOO {} {} + T class-object method FOO {} {} ? {T info methods} {foo} - ? {lsort [T object info methods]} {BAR ZAP bar} + ? {lsort [T class-object info methods]} {BAR ZAP bar} ? {T BAR} ->foo ? {T ZAP} ->foo rename ::T::BAR "" ? {T info methods} {foo} - ? {lsort [T object info methods]} {ZAP bar} + ? {lsort [T class-object info methods]} {ZAP bar} #? {T BAR} ""; # now calling the proc defined above, alias chain seems intact ? {T ZAP} ->foo; # is ok, still pointing to 'foo' - #T object method BAR {} {} + #T class-object method BAR {} {} ? {T info methods} {foo} - ? {lsort [T object info methods]} {ZAP bar} + ? {lsort [T class-object info methods]} {ZAP bar} ? {T ZAP} ->foo T method foo {} {} ? {T info methods} {} - ? {lsort [T object info methods]} {bar} + ? {lsort [T class-object info methods]} {bar} } Test case alias-per-object { Class create T { - :object method bar args { return [current class]->[current method] } + :class-object method bar args { return [current class]->[current method] } :create t } proc ::foo args { return [current class]->[current method] } # # per-object methods as per-object aliases # - T object method m1 args { return [current class]->[current method] } + T class-object method m1 args { return [current class]->[current method] } ::nsf::alias T -per-object M1 ::T::m1 ::nsf::alias T -per-object M11 ::T::M1 - ? {lsort [T object info methods]} {M1 M11 bar m1} + ? {lsort [T class-object info methods]} {M1 M11 bar m1} ? {T m1} ->m1 ? {T M1} ->m1 ? {T M11} ->m1 - T object method M1 {} {} - ? {lsort [T object info methods]} {M11 bar m1} + T class-object method M1 {} {} + ? {lsort [T class-object info methods]} {M11 bar m1} ? {T m1} ->m1 ? {T M11} ->m1 - T object method m1 {} {} - ? {lsort [T object info methods]} {bar} + T class-object method m1 {} {} + ? {lsort [T class-object info methods]} {bar} # # a proc as alias @@ -173,7 +173,7 @@ # ! per-object alias referenced as per-class alias ! # ::nsf::alias T BAR ::T::FOO2 - ? {lsort [T object info methods]} {FOO2 bar} + ? {lsort [T class-object info methods]} {FOO2 bar} ? {lsort [T info methods]} {BAR FOO1} ? {T FOO2} ->foo ? {t FOO1} ::T->foo @@ -182,15 +182,15 @@ # delete proc # rename ::foo "" - ? {lsort [T object info methods]} {bar} + ? {lsort [T class-object info methods]} {bar} ? {lsort [T info methods]} {} } # namespaced procs + namespace deletion Test case alias-namespaced { Class create T { - :object method bar args { return [current class]->[current method] } + :class-object method bar args { return [current class]->[current method] } :create t } @@ -217,19 +217,19 @@ Class create U U create u ? {namespace exists ::U} 0 - U object method zap args { return [current class]->[current method] } + U class-object method zap args { return [current class]->[current method] } ::nsf::alias ::U -per-object ZAP ::U::zap U require namespace ? {namespace exists ::U} 1 - U object method bar args { return [current class]->[current method] } + U class-object method bar args { return [current class]->[current method] } ::nsf::alias U -per-object BAR ::U::bar - ? {lsort [U object info methods]} {BAR ZAP bar zap} + ? {lsort [U class-object info methods]} {BAR ZAP bar zap} ? {U BAR} ->bar ? {U ZAP} ->zap namespace delete ::U ? {namespace exists ::U} 0 - ? {lsort [U object info methods]} {} + ? {lsort [U class-object info methods]} {} ? {U info lookup methods BAR} "" ? {U info lookup methods ZAP} "" @@ -243,7 +243,7 @@ Class create V { set :z 1 :method bar {z} { return $z } - :object method bar {z} { return $z } + :class-object method bar {z} { return $z } :create v { set :z 2 } @@ -258,15 +258,15 @@ ::nsf::alias V FOO1 ::foo ::nsf::alias V -per-object FOO2 ::foo - ? {lsort [V object info methods]} {FOO2 bar} + ? {lsort [V class-object info methods]} {FOO2 bar} ? {lsort [V info methods]} {FOO1 bar} ? {V FOO2} 1-1-1 ? {v FOO1} 2-2-2 V method FOO1 {} {} ? {lsort [V info methods]} {bar} rename ::foo "" - ? {lsort [V object info methods]} {bar} + ? {lsort [V class-object info methods]} {bar} } # Index: tests/doc.tcl =================================================================== diff -u -r25f4f3c883ff0021b8564377f6658afb69c346c8 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/doc.tcl (.../doc.tcl) (revision 25f4f3c883ff0021b8564377f6658afb69c346c8) +++ tests/doc.tcl (.../doc.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -460,7 +460,7 @@ } - :object method foo {a b c} { + :class-object method foo {a b c} { # This describes the per-object foo method in the method body # # @parameter b Provides a second value (refined) @@ -631,7 +631,7 @@ } # @.object-attribute attr2 Carries a short desc only - :object attribute attr2 + :class-object attribute attr2 # @.method foo # @@ -647,7 +647,7 @@ # # This extended form allows to describe a method parameter with all # its structural features! - set barHandle [:object method bar {p1} { + set barHandle [:class-object method bar {p1} { return [current method]-$p1-[current] }] @@ -688,7 +688,7 @@ :attribute p1 # @..object-attribute p2 - :object attribute p2 + :class-object attribute p2 } @@ -702,7 +702,7 @@ # forwarder in the context of an owning @method object!) # # @parameter p1 Some words on p1 - :object alias "sub foo" $fooHandle + :class-object alias "sub foo" $fooHandle # @.method sub # @@ -731,7 +731,7 @@ # @parameter p1 Some words on p1 # @see anotherentity # @author ss@thinkersfoot.net - :object alias "sub foo2" $fooHandle + :class-object alias "sub foo2" $fooHandle } } @@ -843,7 +843,7 @@ ? [list ::nsf::isobject $entity] 1 ? [list $entity as_text] "" # --testing-- @object-method.parameter {bar p1} (its non-existance) It - # still cannot exist as a documented entity, as the object method + # still cannot exist as a documented entity, as the class-object method # has not been initialised before! set entity [@parameter id [@method id ::C object bar] "" p1] ? [list ::nsf::isobject $entity] 0 Index: tests/forwardtest.tcl =================================================================== diff -u -rf1cd1537386ab1fdfabccaadae215990e376ae9d -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/forwardtest.tcl (.../forwardtest.tcl) (revision f1cd1537386ab1fdfabccaadae215990e376ae9d) +++ tests/forwardtest.tcl (.../forwardtest.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -285,8 +285,8 @@ Class create NS Class create NS::Main { - :object method m1 {} { :m2 } - :object method m2 {} { + :class-object method m1 {} { :m2 } + :class-object method m2 {} { ? {namespace eval :: {Object create toplevelObj1}} ::toplevelObj1 ? [list set _ [namespace current]] ::NS @@ -365,7 +365,7 @@ Class create C { :method xx {} {current} - :object method t {o expr} { + :class-object method t {o expr} { return [$o expr $expr] } } Index: tests/info-method.tcl =================================================================== diff -u -rb5b08b9cc2fea92762787311da318d49d77d2a7b -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/info-method.tcl (.../info-method.tcl) (revision b5b08b9cc2fea92762787311da318d49d77d2a7b) +++ tests/info-method.tcl (.../info-method.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -8,18 +8,18 @@ nx::Class create C { :method m {x} {return proc-[self proc]} - :object method mpo {} {return instproc-[self proc]} + :class-object method mpo {} {return instproc-[self proc]} :method m-with-assertions {} {return proc-[self proc]} -precondition 1 -postcondition 2 :forward addOne expr 1 + - :object forward add1 expr 1 + - :object forward fpo ::o + :class-object forward add1 expr 1 + + :class-object forward fpo ::o :setter s - :object setter spo + :class-object setter spo :alias a ::set - :object alias apo ::puts + :class-object alias apo ::puts } C create c1 @@ -38,11 +38,11 @@ ? {c1 info lookup method foo} "::c1::foo" ? {C info method handle m} "::nsf::classes::C::m" - ? {C object info method handle mpo} "::C::mpo" + ? {C class-object info method handle mpo} "::C::mpo" ? {C info method definition m} {::C method m x {return proc-[self proc]}} ? {C info method def m} {::C method m x {return proc-[self proc]}} - ? {C object info method definition mpo} {::C object method mpo {} {return instproc-[self proc]}} + ? {C class-object info method definition mpo} {::C class-object method mpo {} {return instproc-[self proc]}} ? {C info method definition m-with-assertions} \ {::C method m-with-assertions {} {return proc-[self proc]} -precondition 1 -postcondition 2} ? {C info method parameter m} {x} @@ -54,14 +54,14 @@ ? {catch {C info method parameter a}} 1 ? {C info method definition addOne} "::C forward addOne expr 1 +" - ? {C object info method definition add1} "::C object forward add1 expr 1 +" - ? {C object info method definition fpo} "::C object forward fpo ::o" + ? {C class-object info method definition add1} "::C class-object forward add1 expr 1 +" + ? {C class-object info method definition fpo} "::C class-object forward fpo ::o" ? {C info method definition s} "::C setter s" - ? {C object info method definition spo} "::C object setter spo" + ? {C class-object info method definition spo} "::C class-object setter spo" ? {C info method definition a} "::C alias a ::set" - ? {C object info method definition apo} "::C object alias apo ::puts" + ? {C class-object info method definition apo} "::C class-object alias apo ::puts" ? {::nx::Object info lookup methods -application} "" ? {::nx::Class info lookup methods -application} "" @@ -130,16 +130,16 @@ ? {Foo info filter methods -guards} "{f -guard {2 == 2}} f2" ? {Foo filter {}} "" - ? {Foo object method f args ::nx::next} "::Foo::f" - ? {Foo object method f2 args ::nx::next} "::Foo::f2" - ? {Foo object filter {f f2}} "" - ? {Foo object info filter methods} "f f2" - ? {Foo object filter guard f {2 == 2}} "" - ? {Foo object info filter guard f} "2 == 2" - ? {Foo object info filter methods -guards f} "{f -guard {2 == 2}}" - ? {Foo object info filter methods -guards f2} "f2" - ? {Foo object info filter methods -guards} "{f -guard {2 == 2}} f2" - ? {Foo object filter {}} "" + ? {Foo class-object method f args ::nx::next} "::Foo::f" + ? {Foo class-object method f2 args ::nx::next} "::Foo::f2" + ? {Foo class-object filter {f f2}} "" + ? {Foo class-object info filter methods} "f f2" + ? {Foo class-object filter guard f {2 == 2}} "" + ? {Foo class-object info filter guard f} "2 == 2" + ? {Foo class-object info filter methods -guards f} "{f -guard {2 == 2}}" + ? {Foo class-object info filter methods -guards f2} "f2" + ? {Foo class-object info filter methods -guards} "{f -guard {2 == 2}} f2" + ? {Foo class-object filter {}} "" Foo destroy nx::Class create Fly @@ -161,14 +161,14 @@ Foo mixin delete ::Fly ? {Foo info mixin classes} "::nx::Class" - Foo object mixin add ::nx::Class - Foo object mixin add Fly - ? {Foo object info mixin classes} "::Fly ::nx::Class" - ? {Foo object mixin guard ::Fly {1}} "" - ? {Foo object info mixin classes -guards} "{::Fly -guard 1} ::nx::Class" - ? {Foo object info mixin classes -guards Fly} "{::Fly -guard 1}" - Foo object mixin delete ::Fly - ? {Foo object info mixin classes} "::nx::Class" + Foo class-object mixin add ::nx::Class + Foo class-object mixin add Fly + ? {Foo class-object info mixin classes} "::Fly ::nx::Class" + ? {Foo class-object mixin guard ::Fly {1}} "" + ? {Foo class-object info mixin classes -guards} "{::Fly -guard 1} ::nx::Class" + ? {Foo class-object info mixin classes -guards Fly} "{::Fly -guard 1}" + Foo class-object mixin delete ::Fly + ? {Foo class-object info mixin classes} "::nx::Class" ? {Foo info lookup methods superclass} "superclass" ? {Foo info lookup method superclass} "::nsf::classes::nx::Class::superclass" @@ -186,7 +186,7 @@ nx::Class create D -superclass C { :attribute {b 2} :attribute c - :object attribute a2 + :class-object attribute a2 :method "sub foo" args {;} } @@ -210,8 +210,8 @@ :method "bar b" {x:int y:upper} {return b} :method "bar baz x" {x:int y:upper} {return x} :method "bar baz y" {x:int y:upper} {return y} - :object method "foo x" {z:int} {return z} - :object method "foo y" {z:int} {return z} + :class-object method "foo x" {z:int} {return z} + :class-object method "foo y" {z:int} {return z} } # query definition on subcommand @@ -255,12 +255,12 @@ ? {C info method definition "::nsf::classes::C::bar b"} {::C method {bar b} {x:int y:upper} {return b}} ? {o2 info method definition "::nsf::classes::C::bar b"} {::C method {bar b} {x:int y:upper} {return b}} - ? {C object info method handle "foo"} {::C::foo} - ? {C object info method handle "foo x"} {::C::foo x} + ? {C class-object info method handle "foo"} {::C::foo} + ? {C class-object info method handle "foo x"} {::C::foo x} - ? {C object info method definition "::C::foo x"} {::C object method {foo x} z:int {return z}} - ? {C info method definition "::C::foo x"} {::C object method {foo x} z:int {return z}} - ? {o2 info method definition "::C::foo x"} {::C object method {foo x} z:int {return z}} + ? {C class-object info method definition "::C::foo x"} {::C class-object method {foo x} z:int {return z}} + ? {C info method definition "::C::foo x"} {::C class-object method {foo x} z:int {return z}} + ? {o2 info method definition "::C::foo x"} {::C class-object method {foo x} z:int {return z}} ? {C info method definition "bar baz y"} \ {::C method {bar baz y} {x:int y:upper} {return y}} Index: tests/interceptor-slot.tcl =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/interceptor-slot.tcl (.../interceptor-slot.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ tests/interceptor-slot.tcl (.../interceptor-slot.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -45,7 +45,7 @@ # ::nsf::relation C object-mixin M ? {C info precedence} "::M ::nx::Class ::nx::Object" -? {C object info mixin classes} "::M" +? {C class-object info mixin classes} "::M" ::nsf::relation C object-mixin "" ? {C info precedence} "::nx::Class ::nx::Object" @@ -55,48 +55,48 @@ # # C object-mixin M # ? {C info precedence} "::M ::nx::Class ::nx::Object" -# ? {C object info mixin classes} "::M" +# ? {C class-object info mixin classes} "::M" # C object-mixin "" # ? {C info precedence} "::nx::Class ::nx::Object" # -# add and remove object mixin for classes via modifier "object" and +# add and remove class-object mixin for classes via modifier "object" and # "mixin" # -C object mixin M +C class-object mixin M ? {C info precedence} "::M ::nx::Class ::nx::Object" -? {C object info mixin classes} "::M" -C object mixin "" +? {C class-object info mixin classes} "::M" +C class-object mixin "" ? {C info precedence} "::nx::Class ::nx::Object" # -# add and remove object mixin for classes via object mixin add +# add and remove class-object mixin for classes via class-object mixin add # -C object mixin add M +C class-object mixin add M ? {C info precedence} "::M ::nx::Class ::nx::Object" -? {C object info mixin classes} "::M" -C object mixin "" +? {C class-object info mixin classes} "::M" +C class-object mixin "" ? {C info precedence} "::nx::Class ::nx::Object" # # adding per-object mixins for classes via "object mixin add M" # -C object mixin add M +C class-object mixin add M ? {C info precedence} "::M ::nx::Class ::nx::Object" ? {::nsf::relation C object-mixin} ::M -? {catch {C object mixin add UNKNOWN}} 1 +? {catch {C class-object mixin add UNKNOWN}} 1 ? {::nsf::relation C object-mixin} "::M" -C object mixin "" +C class-object mixin "" ? {C info precedence} "::nx::Class ::nx::Object" # # adding per-object mixins for classes via "object mixin M" # -C object mixin M +C class-object mixin M ? {C info precedence} "::M ::nx::Class ::nx::Object" # forwarder with 0 arguments + flag -? {C object mixin} "::M" +? {C class-object mixin} "::M" Test case mixin-add { @@ -108,17 +108,17 @@ Class create C1 ? {C1 info lookup method mixin} "::nsf::classes::nx::Class::mixin" - C1 object mixin M1 + C1 class-object mixin M1 ? {C1 info precedence} "::M1 ::nx::Class ::nx::Object" C1 create c11 ? {c11 info precedence} "::C1 ::nx::Object" - C1 object mixin add M11 + C1 class-object mixin add M11 ? {C1 info precedence} "::M11 ::M1 ::nx::Class ::nx::Object" Object create o -mixin M1 ? {o info precedence} "::M1 ::nx::Object" Class create O - O object mixin M1 + O class-object mixin M1 ? {O info precedence} "::M1 ::nx::Class ::nx::Object" Class create O -object-mixin M1 ? {O info precedence} "::M1 ::nx::Class ::nx::Object" Index: tests/method-modifiers.tcl =================================================================== diff -u -r693aa83247d37e11744c0a442ec10b22d218db9f -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/method-modifiers.tcl (.../method-modifiers.tcl) (revision 693aa83247d37e11744c0a442ec10b22d218db9f) +++ tests/method-modifiers.tcl (.../method-modifiers.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -25,18 +25,18 @@ :protected alias protected_alias [C info method handle protected_method] # object - :object method plain_object_method {} {return [current method]} - :public object method public_object_method {} {return [current method]} - :protected object method protected_object_method {} {return [current method]} - :object forward plain_object_forward %self plain_object_method - :public object forward public_object_forward %self public_object_method - :protected object forward protected_object_forward %self protected_object_method - :object setter plain_object_setter - :public object setter public_object_setter - :protected object setter protected_object_setter - :object alias plain_object_alias [:object info method handle plain_object_method] - :public object alias public_object_alias [:object info method handle public_object_method] - :protected object alias protected_object_alias [:object info method handle protected_object_method] + :class-object method plain_object_method {} {return [current method]} + :public class-object method public_object_method {} {return [current method]} + :protected class-object method protected_object_method {} {return [current method]} + :class-object forward plain_object_forward %self plain_object_method + :public class-object forward public_object_forward %self public_object_method + :protected class-object forward protected_object_forward %self protected_object_method + :class-object setter plain_object_setter + :public class-object setter public_object_setter + :protected class-object setter protected_object_setter + :class-object alias plain_object_alias [:class-object info method handle plain_object_method] + :public class-object alias public_object_alias [:class-object info method handle public_object_method] + :protected class-object alias protected_object_alias [:class-object info method handle protected_object_method] } C create c1 { # methods @@ -63,7 +63,7 @@ C protected setter s1 ? {c1 s0 0} 0 ? {::nsf::dispatch c1 s1 1} 1 -C object setter s3 +C class-object setter s3 ? {C s3 3} 3 # create a fresh object (different from c1) @@ -168,7 +168,7 @@ ? {lsort [c1 info methods]} \ "plain_object_alias plain_object_forward plain_object_method plain_object_setter public_object_alias public_object_forward public_object_method public_object_setter" - ? {lsort [C object info methods]} \ + ? {lsort [C class-object info methods]} \ "plain_object_alias plain_object_forward plain_object_method plain_object_setter public_object_alias public_object_forward public_object_method public_object_setter s3" } @@ -186,23 +186,23 @@ C mixin guard M {} ? {C info mixin guard M} "" - # now the same as object mixin and object mixin guard - C object mixin M - C object mixin guard M {1 == 1} - ? {C object info mixin guard M} "1 == 1" - C object mixin guard M {} - ? {C object info mixin guard M} "" + # now the same as class-object mixin and class-object mixin guard + C class-object mixin M + C class-object mixin guard M {1 == 1} + ? {C class-object info mixin guard M} "1 == 1" + C class-object mixin guard M {} + ? {C class-object info mixin guard M} "" } Test case mixin-via-objectparam { # add an object and class mixin via object-parameter and via slots Class create M1; Class create M2; Class create M3; Class create M4 Class create C -mixin M1 -object-mixin M2 { :mixin add M3 - :object mixin add M4 + :class-object mixin add M4 } - ? {lsort [C object info mixin classes]} "::M2 ::M4" + ? {lsort [C class-object info mixin classes]} "::M2 ::M4" ? {lsort [C info mixin classes]} "::M1 ::M3" C destroy M1 destroy; M2 destroy; M3 destroy; M4 destroy; @@ -243,13 +243,13 @@ :public attribute {c c1} :protected attribute {d d1} #puts stderr ====== - set X [:object attribute A] + set X [:class-object attribute A] ? [list set _ $X] "::C::A" #exit - # object attribute with default - :object attribute {B B2} - :public object attribute {C C2} - :protected object attribute {D D2} + # class-object attribute with default + :class-object attribute {B B2} + :public class-object attribute {C C2} + :protected class-object attribute {D D2} } C create c1 -a 1 @@ -287,8 +287,8 @@ :method "Info args" {} {return [current object]-[current method]} :method "Info foo" {} {return [current object]-[current method]} - :object method "INFO filter guard" {a b} {return [current object]-[current method]} - :object method "INFO filter methods" {-guards pattern:optional} {return [current object]-[current method]} + :class-object method "INFO filter guard" {a b} {return [current object]-[current method]} + :class-object method "INFO filter methods" {-guards pattern:optional} {return [current object]-[current method]} } ? {Foo INFO filter guard 1 2} ::Foo-guard Index: tests/method-require.tcl =================================================================== diff -u -r15d57478e3976d747741fd3df9bcb6ecccc7076d -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/method-require.tcl (.../method-require.tcl) (revision 15d57478e3976d747741fd3df9bcb6ecccc7076d) +++ tests/method-require.tcl (.../method-require.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -36,12 +36,12 @@ :require method tcl::set # object methods: - :require object method lappend + :require class-object method lappend # a scripted method - :require object method foo + :require class-object method foo - :require object method x + :require class-object method x # looks as well ok: :require namespace Index: tests/varresolutiontest.tcl =================================================================== diff -u -r18122dd21b99cf0d5b4cd01635048641a23aa051 -rd168a26bce713de8daa5bbe79d740926e961c5bc --- tests/varresolutiontest.tcl (.../varresolutiontest.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) +++ tests/varresolutiontest.tcl (.../varresolutiontest.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) @@ -709,7 +709,7 @@ set :Z 1 set ZZZ 1 :method bar {z} { return $z } - :object method bar {z} { return $z } + :class-object method bar {z} { return $z } :create v { set zzz 2 set :z 2 @@ -726,7 +726,7 @@ set :Z 1 set ZZZ 1 :method bar {z} { return $z } - :object method bar {z} { return $z } + :class-object method bar {z} { return $z } :create v { set :z 2 set zzz 2