Index: tests/info-method.test =================================================================== diff -u -r3b5d2f4e0bc018420ebea39e54ad3212ade2a5bd -rf858f142f5fab4f88996b3eb709c3afa55114be9 --- tests/info-method.test (.../info-method.test) (revision 3b5d2f4e0bc018420ebea39e54ad3212ade2a5bd) +++ tests/info-method.test (.../info-method.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) @@ -61,23 +61,23 @@ nx::Test case info-method-base { nx::Object create o { - :alias set ::set + :object alias set ::set } nx::Class create C { :method m {x} {return proc-[self proc]} - :class method mpo {} {return instproc-[self proc]} + :object method mpo {} {return instproc-[self proc]} :method m-with-assertions {} {return proc-[self proc]} -precondition 1 -postcondition 2 :forward addOne expr 1 + - :class forward add1 expr 1 + - :class forward fpo ::o + :object forward add1 expr 1 + + :object forward fpo ::o :property -accessor public s - :class property -accessor public spo + :object property -accessor public spo :alias a ::set - :class alias apo ::puts + :object alias apo ::puts } C create c1 @@ -91,15 +91,15 @@ ? {c1 info lookup method addOne} "::nsf::classes::C::addOne" ? {c1 info lookup method m} "::nsf::classes::C::m" ? {c1 info lookup method s} "::nsf::classes::C::s" - c1 method foo {} {puts foo} - ? {c1 info method definition foo} "::c1 public method foo {} {puts foo}" + c1 object method foo {} {puts foo} + ? {c1 info object method definition foo} "::c1 public object method foo {} {puts foo}" ? {c1 info lookup method foo} "::c1::foo" ? {C info method registrationhandle m} "::nsf::classes::C::m" - ? {C class info method registrationhandle mpo} "::C::mpo" + ? {C info object method registrationhandle mpo} "::C::mpo" ? {C info method definition m} {::C public method m x {return proc-[self proc]}} - ? {C class info method definition mpo} {::C public class method mpo {} {return instproc-[self proc]}} + ? {C info object method definition mpo} {::C public object method mpo {} {return instproc-[self proc]}} if {$::nsf::config(assertions)} { ? {C info method definition m-with-assertions} \ {::C public method m-with-assertions {} {return proc-[self proc]} -precondition 1 -postcondition 2} @@ -110,26 +110,26 @@ ? {C info method parameter m} {x} ? {nx::Class info method parameter method} \ {name arguments:parameter,0..* -returns body -precondition -postcondition} - ? {nx::Object info method parameter alias} \ + ? {nx::Class info method parameter alias} \ {methodName -returns {-frame default} cmd} # raises currently an error ? {catch {C info method parameter a}} 1 ? {C info method definition addOne} "::C public forward addOne expr 1 +" - ? {C class info method definition add1} "::C public class forward add1 expr 1 +" - ? {C class info method definition fpo} "::C public class forward fpo ::o" + ? {C info object method definition add1} "::C public object forward add1 expr 1 +" + ? {C info object method definition fpo} "::C public object forward fpo ::o" ? {C info method definition s} "::C public setter s" - ? {C class info method definition spo} "::C public class setter spo" + ? {C info object method definition spo} "::C public object setter spo" ? {C info method definition a} "::C public alias a ::set" - ? {C class info method definition apo} "::C public class alias apo ::puts" + ? {C info object method definition apo} "::C public object alias apo ::puts" ? {::nx::Object info lookup methods -source application} "" ? {::nx::Class info lookup methods -source application} "" - set object_methods "alias cget configure contains copy delete destroy eval filter forward info method mixin move private property protected public require variable volatile" - set class_methods "alias cget class configure contains copy create delete destroy eval filter forward info method mixin move new private property protected public require variable volatile" + set object_methods "cget configure contains copy delete destroy eval info move object private property protected public require variable volatile" + set class_methods "alias cget configure contains copy create delete destroy eval filter forward info method mixin move new object private property protected public require variable volatile" ? {lsort [::nx::Object info lookup methods -source baseclasses]} $class_methods ? {lsort [::nx::Class info lookup methods -source baseclasses]} $class_methods @@ -152,7 +152,7 @@ :protected method bar1 args {;} :method bar2 args {;} :public method foo args {;} - :public class method foo args {;} + :public object method foo args {;} } ? {lsort [MC info methods -methodtype scripted -callprotection public]} "foo" @@ -176,15 +176,15 @@ nx::Test case visability-sub-objects { ::nx::Object create o { ::nx::Object create [::nx::self]::sub { - :method foo {} {;} + :object method foo {} {;} } - :public alias soAlias ::o::sub + :public object alias soAlias ::o::sub } # # per default, we see the alias and the subobject # - ? {o info methods} "soAlias sub" - ? {o info method type soAlias} "alias" + ? {o info object methods} "soAlias sub" + ? {o info object method type soAlias} "alias" # the subobject can be hidden via private (see protection.test) } @@ -243,34 +243,34 @@ # alias to tcl-cmd (no param defs for in-parameters) :alias incr -returns integer -frame object ::incr :forward ++ -returns integer ::expr 1 + - :public class method instances {} -returns object,1..n {:info instances} + :public object method instances {} -returns object,1..n {:info instances} :create c1 { - :public method foo {} -returns integer {;} - :public method "bar baz" {} -returns integer {;} - :public method "bar boo" {} -returns integer {;} + :public object method foo {} -returns integer {;} + :public object method "bar baz" {} -returns integer {;} + :public object method "bar boo" {} -returns integer {;} } } ? {C info method returns bar-ok1} "integer" ? {C info method returns bar-nok} "integer" ? {C info method returns incr} "integer" ? {C info method returns ++} "integer" - ? {C class info method returns instances} "object,1..n" - ? {c1 info method returns foo} "integer" - ? {c1 info method returns "bar baz"} "integer" - ? {c1 info method returns "bar boo"} "integer" + ? {C info object method returns instances} "object,1..n" + ? {c1 info object method returns foo} "integer" + ? {c1 info object method returns "bar baz"} "integer" + ? {c1 info object method returns "bar boo"} "integer" # # Ensemble object ... # - ? {c1 info method returns bar} "" + ? {c1 info object method returns bar} "" # # Non-existing method ... # - ? {c1 info method returns baf} "" + ? {c1 info object method returns baf} "" # # Non-existing submethod ... # - ? {c1 info method returns "bar baf"} "" + ? {c1 info object method returns "bar baf"} "" } nx::Test case method-definition-with-returns { @@ -285,10 +285,10 @@ # alias to tcl-cmd (no param defs for in-parameters) :alias incr -returns integer -frame object ::incr :forward ++ -returns integer ::expr 1 + - :public class method instances {} -returns object,1..n {;} + :public object method instances {} -returns object,1..n {;} :create c1 { - :public method foo {} -returns integer {;} - :method "bar baz" {} -returns integer {;} + :public object method foo {} -returns integer {;} + :object method "bar baz" {} -returns integer {;} } } @@ -298,11 +298,11 @@ ? {C info method definition incr} "::C public alias incr -frame object -returns integer ::incr" ? {C info method definition ++} "::C public forward ++ -returns integer ::expr 1 +" - ? {C class info method definition instances} \ - "::C public class method instances {} -returns object,1..n {;}" + ? {C info object method definition instances} \ + "::C public object method instances {} -returns object,1..n {;}" - ? {c1 info method definition foo} "::c1 public method foo {} -returns integer {;}" - ? {c1 info method definition "bar baz"} "::c1 public method {bar baz} {} -returns integer {;}" + ? {c1 info object method definition foo} "::c1 public object method foo {} -returns integer {;}" + ? {c1 info object method definition "bar baz"} "::c1 public object method {bar baz} {} -returns integer {;}" } @@ -315,20 +315,20 @@ # alias to tcl-cmd (no param defs for in-parameters) :alias incr -returns integer -frame object ::incr :forward ++ -returns integer ::expr 1 + - :public class method instances {} -returns object,1..n {;} + :public object method instances {} -returns object,1..n {;} :create c1 { - :public method foo {} -returns integer {;} - :method "bar baz" {} -returns integer {;} + :public object method foo {} -returns integer {;} + :object method "bar baz" {} -returns integer {;} } } c1 copy c2 - ? {c2 info method returns foo} [c1 info method returns foo] - ? {c2 info method definition foo} [lreplace [c1 info method definition foo] 0 0 ::c2] - ? {c2 info method returns "bar baz"} [c1 info method returns "bar baz"] - ? {c2 info method definition "bar baz"} [lreplace [c1 info method definition "bar baz"] 0 0 ::c2] - ? {c2 info method returns "bar boo"} [c1 info method returns "bar boo"] + ? {c2 info object method returns foo} [c1 info object method returns foo] + ? {c2 info object method definition foo} [lreplace [c1 info object method definition foo] 0 0 ::c2] + ? {c2 info object method returns "bar baz"} [c1 info object method returns "bar baz"] + ? {c2 info object method definition "bar baz"} [lreplace [c1 info object method definition "bar baz"] 0 0 ::c2] + ? {c2 info object method returns "bar boo"} [c1 info object method returns "bar boo"] C copy CC @@ -342,8 +342,8 @@ # # ? {CC info method returns incr} [C info method returns incr] # ? {CC info method returns ++} [C info method returns ++] - ? {CC class info method returns instances} [C class info method returns instances] - ? {CC class info method definition instances} [lreplace [C class info method definition instances] 0 0 ::CC] + ? {CC info object method returns instances} [C info object method returns instances] + ? {CC info object method definition instances} [lreplace [C info object method definition instances] 0 0 ::CC] } # @@ -364,36 +364,36 @@ ? {o info lookup methods bar} bar ? {o bar} Object.bar - o mixin ::nx::Class + o object mixin ::nx::Class ? {o info precedence} "::nx::Class ::nx::Object" ? {o info lookup method bar} "::nsf::classes::nx::Class::bar" ? {o info lookup methods bar} bar ? {o info lookup methods create} "" ? {o info lookup method create} "" ? {o bar} Class.bar - ? {o method foo {} {return o.foo}} "::o::foo" - ? {o alias is ::nsf::is} "::o::is" - #? {o property x} {variable definition for 'x' (without value and accessor) is useless} + ? {o object method foo {} {return o.foo}} "::o::foo" + ? {o object alias is ::nsf::is} "::o::is" + #? {o object property x} {variable definition for 'x' (without value and accessor) is useless} ? {o property x} "::o::x" ? {o property -accessor public x} "::o::x" - ? {lsort [o info methods]} "foo is x" + ? {lsort [o info object methods]} "foo is x" #? {o property A} {variable definition for 'A' (without value and accessor) is useless} ? {o property A} ::o::A ? {o property -accessor public A} ::o::A - ? {o forward fwd ::set} ::o::fwd - ? {lsort [o info methods]} "A foo fwd is x" + ? {o object forward fwd ::set} ::o::fwd + ? {lsort [o info object methods]} "A foo fwd is x" - o method f args ::nx::next + o object method f args ::nx::next ? {o info lookup methods create} "" - ? {o info lookup methods filter} "filter" - ? {o info lookup method filter} "::nsf::classes::nx::Object::filter" - ? {o filter f} "f" - ? {o filter guard f { 1 == 1 }} "" - ? {o info filter guard f} " 1 == 1 " - ? {o filter guard f} " 1 == 1 " - o filter "" + ? {o info lookup methods configure} configure + ? {o info lookup method configure} "::nsf::classes::nx::Object::configure" + ? {o object filter f} "f" + ? {o object filter guard f { 1 == 1 }} "" + ? {o info object filter guard f} " 1 == 1 " + ? {o object filter guard f} " 1 == 1 " + o object filter "" nx::Class create Foo ? {Foo method f args ::nx::next} "::nsf::classes::Foo::f" @@ -407,26 +407,26 @@ ? {Foo info filter methods -guards} "{f -guard {2 == 2}} f2" ? {Foo filter {}} "" - ? {Foo class method f args ::nx::next} "::Foo::f" - ? {Foo class method f2 args ::nx::next} "::Foo::f2" - ? {Foo class filter {f f2}} "f f2" - ? {Foo class info filter methods} "f f2" - ? {Foo class filter guard f {2 == 2}} "" - ? {Foo class info filter guard f} "2 == 2" - ? {Foo class info filter methods -guards f} "{f -guard {2 == 2}}" - ? {Foo class info filter methods -guards f2} "f2" - ? {Foo class info filter methods -guards} "{f -guard {2 == 2}} f2" - ? {Foo class filter {}} "" + ? {Foo object method f args ::nx::next} "::Foo::f" + ? {Foo object method f2 args ::nx::next} "::Foo::f2" + ? {Foo object filter {f f2}} "f f2" + ? {Foo info object filter methods} "f f2" + ? {Foo object filter guard f {2 == 2}} "" + ? {Foo info object filter guard f} "2 == 2" + ? {Foo info object filter methods -guards f} "{f -guard {2 == 2}}" + ? {Foo info object filter methods -guards f2} "f2" + ? {Foo info object filter methods -guards} "{f -guard {2 == 2}} f2" + ? {Foo object filter {}} "" Foo destroy nx::Class create Fly - o mixin add Fly - ? {o info mixin classes} "::Fly ::nx::Class" - ? {o mixin guard ::Fly {1}} "" - ? {o info mixin classes -guards} "{::Fly -guard 1} ::nx::Class" - ? {o info mixin classes -guards Fly} "{::Fly -guard 1}" - o mixin delete ::Fly - ? {o info mixin classes} "::nx::Class" + o object mixin add Fly + ? {o info object mixin classes} "::Fly ::nx::Class" + ? {o object mixin guard ::Fly {1}} "" + ? {o info object mixin classes -guards} "{::Fly -guard 1} ::nx::Class" + ? {o info object mixin classes -guards Fly} "{::Fly -guard 1}" + o object mixin delete ::Fly + ? {o info object mixin classes} "::nx::Class" nx::Class create Foo Foo mixin add ::nx::Class @@ -438,20 +438,20 @@ Foo mixin delete ::Fly ? {Foo info mixin classes} "::nx::Class" - Foo class mixin add ::nx::Class - Foo class mixin add Fly - ? {Foo class info mixin classes} "::Fly ::nx::Class" - ? {Foo class mixin guard ::Fly {1}} "" - ? {Foo class info mixin classes -guards} "{::Fly -guard 1} ::nx::Class" - ? {Foo class info mixin classes -guards Fly} "{::Fly -guard 1}" + Foo object mixin add ::nx::Class + Foo object mixin add Fly + ? {Foo info object mixin classes} "::Fly ::nx::Class" + ? {Foo object mixin guard ::Fly {1}} "" + ? {Foo info object mixin classes -guards} "{::Fly -guard 1} ::nx::Class" + ? {Foo info object mixin classes -guards Fly} "{::Fly -guard 1}" - Foo class mixin delete ::Fly - ? {Foo class info mixin classes} "::nx::Class" + Foo object mixin delete ::Fly + ? {Foo info object mixin classes} "::nx::Class" ? {Foo info lookup methods create} "create" ? {Foo info lookup method create} "::nsf::classes::nx::Class::create" - ? {o mixin ""} "" + ? {o object mixin ""} "" } @@ -468,7 +468,7 @@ nx::Class create D -superclass C { :property {b 2} :property c - :class property -accessor public {a2 ""} + :object property -accessor public {a2 ""} :method "sub foo" args {;} :create d1 { :property -accessor public {a3 ""} @@ -480,9 +480,9 @@ ? {D info slot objects -closure -source application} "::D::slot::b ::D::slot::c ::C::slot::a" ? {d1 info lookup slots -source application} "::d1::per-object-slot::a3 ::D::slot::b ::D::slot::c ::C::slot::a" - ? {D class info slot objects} "::D::per-object-slot::a2" + ? {D info object slot objects} "::D::per-object-slot::a2" ? {d1 info slot objects} "::d1::per-object-slot::a3" - ? {C class info slot objects} "" + ? {C info object slot objects} "" } # @@ -498,28 +498,28 @@ nx::Class create D -superclass C { :property {b 2} :property c - :class property -accessor public a2 + :object property -accessor public a2 :method "sub foo" args {;} } - ? {D info lookup slots} "::D::per-object-slot::a2 ::nx::Class::slot::superclass ::nx::Class::slot::object-mixin ::nx::Class::slot::mixin ::nx::Class::slot::object-filter ::nx::Class::slot::filter ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::__initcmd ::nx::Object::slot::class" + ? {D info lookup slots} "::D::per-object-slot::a2 ::nx::Class::slot::superclass ::nx::Class::slot::mixin ::nx::Class::slot::filter ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::object-filter" C create c1 ? {c1 info precedence} "::C ::nx::Object" ? {C info heritage} "::nx::Object" ? {C info slot objects -closure -source application} "::C::slot::a ::C::slot::b" - ? {C info slot objects -closure} "::C::slot::a ::C::slot::b ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::filter" + ? {C info slot objects -closure} "::C::slot::a ::C::slot::b ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::object-filter" ? {C info slot objects} "::C::slot::a ::C::slot::b" # Test patterns for "info slot objects" # Partial name, no metachars - ? {C info slot objects -closure mixin} "::nx::Object::slot::mixin" + ? {C info slot objects -closure object-mixin} "::nx::Object::slot::object-mixin" # Partial name with metachars ? {C info slot objects -closure *in*} \ - "::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd" + "::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd" # Fully qualified name, no metachars - ? {C info slot objects -closure ::nx::Object::slot::mixin} "::nx::Object::slot::mixin" + ? {C info slot objects -closure ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" # Fully qualified name, with metachars # The following command returns the same as "C info slot objects" ? {C info slot objects -closure ::C::*} "::C::slot::a ::C::slot::b" @@ -529,12 +529,12 @@ # Test patterns for "info lookup slots" # Partial name, no metachars - ? {c1 info lookup slots mixin} "::nx::Object::slot::mixin" + ? {c1 info lookup slots object-mixin} "::nx::Object::slot::object-mixin" # Partial name with metachars ? {c1 info lookup slots *in*} \ - "::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd" + "::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd" # Fully qualified name, no metachars - ? {c1 info lookup slots ::nx::Object::slot::mixin} "::nx::Object::slot::mixin" + ? {c1 info lookup slots ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" # Fully qualified name, with metachars ? {c1 info lookup slots ::C::*} "::C::slot::a ::C::slot::b" @@ -545,7 +545,7 @@ ? {::nx::Object info method parameter info} "" ? {d1 info precedence} "::D ::C ::nx::Object" - ? {d1 info lookup slots} "::D::slot::b ::D::slot::c ::C::slot::a ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::filter" + ? {d1 info lookup slots} "::D::slot::b ::D::slot::c ::C::slot::a ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::object-filter" # Fully qualified name, with metachars # The following command returns the slots of D inherited from @@ -559,8 +559,8 @@ nx::Test case info-submethod { nx::Object create o { - :method "foo a" {} {return a} - :method "foo b" {x:int y:upper} {return b} + :object method "foo a" {} {return a} + :object method "foo b" {x:int y:upper} {return b} } nx::Object create o2 @@ -569,53 +569,53 @@ :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} - :class method "foo x" {z:int} {return z} - :class method "foo y" {z:int} {return z} + :object method "foo x" {z:int} {return z} + :object method "foo y" {z:int} {return z} } # query definition on submethod - ? {o info method definition "foo b"} {::o public method {foo b} {x:int y:upper} {return b}} + ? {o info object method definition "foo b"} {::o public object method {foo b} {x:int y:upper} {return b}} # query definition on submethod with handle - ? {o info method definition "::o::foo b"} {::o public method {foo b} {x:int y:upper} {return b}} + ? {o info object method definition "::o::foo b"} {::o public object method {foo b} {x:int y:upper} {return b}} # query definition on submethod with handle - ? {o info method definition "::o::foo b"} {::o public method {foo b} {x:int y:upper} {return b}} + ? {o info object method definition "::o::foo b"} {::o public object method {foo b} {x:int y:upper} {return b}} # query definition on submethod with handle called on different object - ? {o2 info method definition "::o::foo b"} {::o public method {foo b} {x:int y:upper} {return b}} + ? {o2 info object method definition "::o::foo b"} {::o public object method {foo b} {x:int y:upper} {return b}} # query definition on handle of ensemble object called on different object - ? {o2 info method definition "::o::foo::b"} {::o::foo public method b {x:int y:upper} {return b}} + ? {o2 info object method definition "::o::foo::b"} {::o::foo public object method b {x:int y:upper} {return b}} # query definition on submethod with handle called on class - ? {o2 info method definition "::o::foo b"} {::o public method {foo b} {x:int y:upper} {return b}} + ? {o2 info object method definition "::o::foo b"} {::o public object method {foo b} {x:int y:upper} {return b}} # query definition on handle of ensemble object called on class - ? {o2 info method definition "::o::foo::b"} {::o::foo public method b {x:int y:upper} {return b}} + ? {o2 info object method definition "::o::foo::b"} {::o::foo public object method b {x:int y:upper} {return b}} # query definition on submethod of class ? {::nx::Object info method definition "info lookup methods"} \ {::nx::Object public alias {info lookup methods} ::nsf::methods::object::info::lookupmethods} # query definition on submethod of class with handle - ? {o info method definition "::nsf::classes::nx::Object::info lookup methods"} \ + ? {o info object method definition "::nsf::classes::nx::Object::info lookup methods"} \ {::nx::Object public alias {info lookup methods} ::nsf::methods::object::info::lookupmethods} # query definition on handle of ensemble object of class - ? {o info method definition "::nx::Object::slot::__info::lookup::methods"} \ - {::nx::Object::slot::__info::lookup public alias methods ::nsf::methods::object::info::lookupmethods} + ? {o info object method definition "::nx::Object::slot::__info::lookup::methods"} \ + {::nx::Object::slot::__info::lookup public object alias methods ::nsf::methods::object::info::lookupmethods} - ? {lsort [o info method submethods dummy]} "" - ? {lsort [o info method submethods foo]} "a b" - ? {lsort [o info method submethods "foo a"]} "" + ? {lsort [o info object method submethods dummy]} "" + ? {lsort [o info object method submethods foo]} "a b" + ? {lsort [o info object method submethods "foo a"]} "" ? {lsort [C info method submethods "bar"]} "a b baz" ? {lsort [C info method submethods "bar a"]} "" ? {lsort [C info method submethods "bar baz"]} "x y" ? {lsort [C info method submethods "bar baz y"]} "" - ? {lsort [C class info method submethods "foo"]} "x y" - ? {lsort [C class info method submethods "foo x"]} "" + ? {lsort [C info object method submethods "foo"]} "x y" + ? {lsort [C info object method submethods "foo x"]} "" # # method handles for ensemble methods @@ -636,20 +636,20 @@ # ? {C info method definition "bar b"} {::C public method {bar b} {x:int y:upper} {return b}} ? {C info method definition "::nsf::classes::C::bar b"} {::C public method {bar b} {x:int y:upper} {return b}} - ? {o2 info method definition "::nsf::classes::C::bar b"} {::C public method {bar b} {x:int y:upper} {return b}} + ? {o2 info object method definition "::nsf::classes::C::bar b"} {::C public method {bar b} {x:int y:upper} {return b}} # # test class modifier on handles # - ? {C class info method registrationhandle "foo"} {::C::foo} - ? {C class info method registrationhandle "foo x"} {::C::foo x} + ? {C info object method registrationhandle "foo"} {::C::foo} + ? {C info object method registrationhandle "foo x"} {::C::foo x} # # info method definition with method paths # - ? {C class info method definition "::C::foo x"} {::C public class method {foo x} z:int {return z}} - ? {C info method definition "::C::foo x"} {::C public class method {foo x} z:int {return z}} - ? {o2 info method definition "::C::foo x"} {::C public class method {foo x} z:int {return z}} + ? {C info object method definition "::C::foo x"} {::C public object method {foo x} z:int {return z}} + ? {C info method definition "::C::foo x"} {::C public object method {foo x} z:int {return z}} + ? {o2 info object method definition "::C::foo x"} {::C public object method {foo x} z:int {return z}} ? {C info method definition "bar baz y"} \ {::C public method {bar baz y} {x:int y:upper} {return y}} @@ -664,11 +664,11 @@ ? {nx::Object info method syntax "info lookup methods"} \ "?-callprotection all|public|protected|private? ?-incontext? ?-methodtype all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ?-nomixins? ?-path? ?-source all|application|baseclasses? ?pattern?" - ? {o info method parameter "foo b"} "x:int y:upper" + ? {o info object method parameter "foo b"} "x:int y:upper" ? {nx::Object info method parameter ::nx::Object::slot::__info::lookup::methods} \ "-callprotection -incontext:switch -methodtype -nomixins:switch -path:switch -source pattern:optional" - ? {o info method parameter "::o::foo::b"} "x:int y:upper" + ? {o info object method parameter "::o::foo::b"} "x:int y:upper" ? {nx::Object info method registrationhandle "info"} "::nsf::classes::nx::Object::info" ? {nx::Object info method registrationhandle "info lookup methods"} \ @@ -677,7 +677,7 @@ ? {nx::Object info method registrationhandle "::nsf::classes::nx::Object::info lookup methods"} \ "::nsf::classes::nx::Object::info lookup methods" - ? {o info method registrationhandle "foo b"} "::o::foo b" + ? {o info object method registrationhandle "foo b"} "::o::foo b" } # @@ -693,28 +693,28 @@ nx::Class create D -superclass C { :property {b 2} :property c - :class property -accessor public a2 + :object property -accessor public a2 :method "sub foo" args {;} } C new - ? {C info parameter syntax} "?-a value? ?-b value? ?-volatile? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?" + ? {C info parameter syntax} "?-a value? ?-b value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?" ? {C info parameter syntax a} "?-a value?" - ? {C info parameter definitions} "-a {-b 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" + ? {C info parameter definitions} "-a {-b 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initcmd:initcmd,optional,noleadingdash" - ? {C info parameter list} "-a -b -volatile -noinit -mixin -class -filter __initcmd" - ? {C info parameter names} "a b volatile noinit mixin class filter __initcmd" - ? {lsort [C info slot objects -closure]} "::C::slot::a ::C::slot::b ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::filter ::nx::Object::slot::mixin ::nx::Object::slot::noinit ::nx::Object::slot::volatile" + ? {C info parameter list} "-a -b -volatile -noinit -object-mixin -class -object-filter __initcmd" + ? {C info parameter names} "a b volatile noinit object-mixin class object-filter __initcmd" + ? {lsort [C info slot objects -closure]} "::C::slot::a ::C::slot::b ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::noinit ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin ::nx::Object::slot::volatile" ? {C info parameter definitions b} "{-b 1}" ? {D info parameter definitions b} "{-b 2}" ? {D info slot objects -closure b} "::D::slot::b" ? {D info slot objects -closure a} "::C::slot::a" ? {D info slot objects -closure class} "::nx::Object::slot::class" - ? {D info parameter list} "-b -c -a -volatile -noinit -mixin -class -filter __initcmd" - ? {D info parameter names} "b c a volatile noinit mixin class filter __initcmd" + ? {D info parameter list} "-b -c -a -volatile -noinit -object-mixin -class -object-filter __initcmd" + ? {D info parameter names} "b c a volatile noinit object-mixin class object-filter __initcmd" } # @@ -729,13 +729,13 @@ ? {lsort [::nx::Object info methods -path "info lookup *"]} \ "{info lookup filter} {info lookup method} {info lookup methods} {info lookup parameter definitions} {info lookup parameter list} {info lookup parameter names} {info lookup parameter syntax} {info lookup slots}" ? {lsort [::nx::Object info methods -path "info *method*"]} \ - "{info filter methods} {info lookup method} {info lookup methods} {info method} {info methods}" + "{info lookup method} {info lookup methods} {info object filter methods} {info object method} {info object methods}" ? {lsort [::nx::Object info methods "slots"]} "" ? {lsort [::nx::Object info methods "*slots*"]} "" ? {lsort [::nx::Object info methods -path "*slot*"]} \ "{info lookup slots} {info slot definitions} {info slot names} {info slot objects}" ? {lsort [::nx::Object info methods -path "*filter*"]} \ - "filter {info filter guard} {info filter methods} {info lookup filter}" + "{info lookup filter} {info object filter guard} {info object filter methods} {object filter}" ::nx::Class create C { :public method "string length" {s} {puts length} @@ -780,12 +780,12 @@ # nx::Test case parametersyntax { # a true method - ? {::nx::Object info method syntax method} "name arguments ?-returns value? body ?-precondition value? ?-postcondition value?" + ? {::nx::Class info method syntax method} "name arguments ?-returns value? body ?-precondition value? ?-postcondition value?" # a forwarder to ::nsf::relation; definition comes via array ::nsf::parametersyntax - ? {::nx::Object info method syntax mixin} "?classes?|?add class?|?delete class?" + ? {::nx::Class info method syntax mixin} "?classes?|?add class?|?delete class?" - ? {::nx::Object info method syntax ::nx::next} "?arguments?" - ? {::nx::Object info method syntax ::nsf::xotclnext} "?--noArgs? ?arg ...?" + ? {::nx::Class info method syntax ::nx::next} "?arguments?" + ? {::nx::Class info method syntax ::nsf::xotclnext} "?--noArgs? ?arg ...?" } # @@ -951,7 +951,7 @@ ? {Agent info heritage} "::MovementTest ::nx::Object" ? {a1 info precedence} "::MovementTest ::Agent ::nx::Object" - a1 mixin {MovementTest MovementLog} + a1 object mixin {MovementTest MovementLog} ? {Agent info heritage} "::MovementTest ::nx::Object" ? {a1 info precedence} "::MovementTest ::MovementLog ::Agent ::nx::Object" @@ -977,9 +977,9 @@ ? {B info heritage} "::M1 ::M2 ::A ::nx::Object" ? {b1 info precedence} "::M1 ::M2 ::B ::A ::nx::Object" - b1 mixin {M1 M1 M4} + b1 object mixin {M1 M1 M4} ? {b1 info precedence} "::M1 ::M4 ::M2 ::B ::A ::nx::Object" - ? {b1 info mixin classes} "::M1 ::M4" + ? {b1 info object mixin classes} "::M1 ::M4" B mixin {M3 M1 M1 M4} ? {B info heritage} "::M3 ::M1 ::M4 ::M2 ::A ::nx::Object" @@ -999,9 +999,9 @@ ? {c1 info precedence} "::C ::nx::Object" # ::A is an implied class - c1 mixin B + c1 object mixin B ? {c1 info precedence} "::B ::A ::C ::nx::Object" - ? {c1 info mixin classes -heritage} "::B ::A" + ? {c1 info object mixin classes -heritage} "::B ::A" # ::A is as well implied by ::PCM C mixin PCM @@ -1013,7 +1013,7 @@ # ::A is not ordered after ::B but after ::PCM ? {c1 info precedence} "::B ::PCM ::A ::C ::nx::Object" - ? {c1 info mixin classes -heritage} "::B ::PCM ::A" + ? {c1 info object mixin classes -heritage} "::B ::PCM ::A" } # @@ -1121,18 +1121,18 @@ ? [list ::nsf::method::registered $h1] ::C - :class method bar {} {return bar} - set h2 [:class info method registrationhandle bar] - ? [list [self] class info method registrationhandle bar] "::C::bar" + :object method bar {} {return bar} + set h2 [:info object method registrationhandle bar] + ? [list [self] info object method registrationhandle bar] "::C::bar" ? [list ::nsf::method::registered $h2] ::C } Object create o { - :method bar {} {return bar} - set h1 [:info method registrationhandle bar] + :object method bar {} {return bar} + set h1 [:info object method registrationhandle bar] ? [list set _ $h1] "::o::bar" - ? [list [self] info method registrationhandle bar] "::o::bar" + ? [list [self] info object method registrationhandle bar] "::o::bar" ? [list ::nsf::method::registered $h1] ::o } @@ -1150,14 +1150,14 @@ ? {set regHandle [C info method registrationhandle "foo bar"]} "::nsf::classes::C::foo bar" ? {set origin [C info method definitionhandle "foo bar"]} "::C::slot::__foo::bar" - ? {set implHandle [C public class method "foo bar" {x} {;}]} "::C::foo::bar" - ? {set regHandle [C class info method registrationhandle "foo bar"]} "::C::foo bar" - ? {set origin [C class info method definitionhandle "foo bar"]} "::C::foo::bar" + ? {set implHandle [C public object method "foo bar" {x} {;}]} "::C::foo::bar" + ? {set regHandle [C info object method registrationhandle "foo bar"]} "::C::foo bar" + ? {set origin [C info object method definitionhandle "foo bar"]} "::C::foo::bar" Object create o - ? {set implHandle [o public method "foo bar" {x} {;}]} "::o::foo::bar" - ? {set regHandle [o info method registrationhandle "foo bar"]} "::o::foo bar" - ? {set origin [o info method definitionhandle "foo bar"]} "::o::foo::bar" + ? {set implHandle [o public object method "foo bar" {x} {;}]} "::o::foo::bar" + ? {set regHandle [o info object method registrationhandle "foo bar"]} "::o::foo bar" + ? {set origin [o info object method definitionhandle "foo bar"]} "::o::foo::bar" } #