Index: TODO =================================================================== diff -u -r39952278bc1e3aa6dda5df7cbe4cffc399f63b98 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- TODO (.../TODO) (revision 39952278bc1e3aa6dda5df7cbe4cffc399f63b98) +++ TODO (.../TODO) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -1223,8 +1223,17 @@ - adoped emulation layer in xotcl2 accordingly - extended regression test +- introduced ::nsf::isobject +- replaced in all scripts "::nsf::objectproperty ... object" by isobject + TODO: +- reflect changes in /is/objectproperty/info has/info is/ in migration guide - rename ObjectInfo2 & ClassInfo2 +- check equivalence of the following two commands + in respect to fully-qualified names + ::nsf::dispatch $obj ::nsf::cmd::ObjectInfo2::hastype $class + ::nsf::parametercheck object,type=$class $obj + - check "my" vs. "nsf::dispatch" in xotcl2.tcl - overthink decision about not showing "child objects" per default in "info methods" Index: doc/next-migration.html =================================================================== diff -u -r6f127ecf78a90478bc889376cb0cb0c05d55b451 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- doc/next-migration.html (.../next-migration.html) (revision 6f127ecf78a90478bc889376cb0cb0c05d55b451) +++ doc/next-migration.html (.../next-migration.html) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -1261,10 +1261,8 @@ obj isobject obj2 - ::nsf::objectproperty obj object -
- obj info is object - + ::nsf::isobject obj + @@ -1447,6 +1445,6 @@
- Last modified: Tue Aug 31 10:41:17 CEST 2010 + Last modified: Tue Aug 31 21:43:43 CEST 2010 Index: generic/aol-xotcl.tcl =================================================================== diff -u -r183ec0e7c071586238bf5ed90a05dbbda91d4582 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- generic/aol-xotcl.tcl (.../aol-xotcl.tcl) (revision 183ec0e7c071586238bf5ed90a05dbbda91d4582) +++ generic/aol-xotcl.tcl (.../aol-xotcl.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -23,7 +23,7 @@ _ns_getnamespaces namespaces foreach n $namespaces { if {[string match "::nx*" $n] == 0 - && ([catch {::xotcl::objectproperty $n object} ret] || $ret == 0)} { + && ([catch {::nsf::isobject $n} ret] || $ret == 0)} { lappend nslist $n } } Index: generic/gentclAPI.decls =================================================================== diff -u -r39952278bc1e3aa6dda5df7cbe4cffc399f63b98 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 39952278bc1e3aa6dda5df7cbe4cffc399f63b98) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -91,6 +91,9 @@ {-argName "value" -required 1 -type tclobj} {-argName "constraint" -required 1 -type tclobj} } +xotclCmd isobject XOTclIsObjectCmd { + {-argName "object" -required 1 -type tclobj} +} xotclCmd method XOTclMethodCmd { {-argName "object" -required 1 -type object} {-argName "-inner-namespace"} Index: generic/tclAPI.h =================================================================== diff -u -r39952278bc1e3aa6dda5df7cbe4cffc399f63b98 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- generic/tclAPI.h (.../tclAPI.h) (revision 39952278bc1e3aa6dda5df7cbe4cffc399f63b98) +++ generic/tclAPI.h (.../tclAPI.h) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -214,6 +214,7 @@ static int XOTclInterpObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclInvalidateObjectParameterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclIsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int XOTclIsObjectCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclMethodCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclMethodPropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclMyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -293,6 +294,7 @@ static int XOTclInterpObjCmd(Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[]); static int XOTclInvalidateObjectParameterCmd(Tcl_Interp *interp, XOTclClass *class); static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *value, Tcl_Obj *constraint); +static int XOTclIsObjectCmd(Tcl_Interp *interp, Tcl_Obj *object); static int XOTclMethodCmd(Tcl_Interp *interp, XOTclObject *object, int withInner_namespace, int withPer_object, int withPublic, Tcl_Obj *name, Tcl_Obj *args, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); static int XOTclMethodPropertyCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, Tcl_Obj *methodName, int methodproperty, Tcl_Obj *value); static int XOTclMyCmd(Tcl_Interp *interp, int withLocal, Tcl_Obj *method, int nobjc, Tcl_Obj *CONST nobjv[]); @@ -373,6 +375,7 @@ XOTclInterpObjCmdIdx, XOTclInvalidateObjectParameterCmdIdx, XOTclIsCmdIdx, + XOTclIsObjectCmdIdx, XOTclMethodCmdIdx, XOTclMethodPropertyCmdIdx, XOTclMyCmdIdx, @@ -1724,6 +1727,24 @@ } static int +XOTclIsObjectCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + parseContext pc; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[XOTclIsObjectCmdIdx].paramDefs, + method_definitions[XOTclIsObjectCmdIdx].nrParameters, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + Tcl_Obj *object = (Tcl_Obj *)pc.clientData[0]; + + parseContextRelease(&pc); + return XOTclIsObjectCmd(interp, object); + + } +} + +static int XOTclMethodCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -2216,6 +2237,9 @@ {"value", 1, 0, convertToTclobj}, {"constraint", 1, 0, convertToTclobj}} }, +{"::nsf::isobject", XOTclIsObjectCmdStub, 1, { + {"object", 1, 0, convertToTclobj}} +}, {"::nsf::method", XOTclMethodCmdStub, 9, { {"object", 1, 0, convertToObject}, {"-inner-namespace", 0, 0, convertToString}, Index: generic/xotcl.c =================================================================== diff -u -r39952278bc1e3aa6dda5df7cbe4cffc399f63b98 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- generic/xotcl.c (.../xotcl.c) (revision 39952278bc1e3aa6dda5df7cbe4cffc399f63b98) +++ generic/xotcl.c (.../xotcl.c) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -11541,6 +11541,18 @@ } /* +xotclCmd isobject XOTclIsObjectCmd { + {-argName "object" -required 1 -type tclobj} +} +*/ +static int XOTclIsObjectCmd(Tcl_Interp *interp, Tcl_Obj *valueObj) { + XOTclObject *object; + Tcl_SetBooleanObj(Tcl_GetObjResult(interp), GetObjectFromObj(interp, valueObj, &object) == TCL_OK); + return TCL_OK; +} + + +/* xotclCmd method XOTclMethodCmd { {-argName "object" -required 1 -type object} {-argName "-inner-namespace"} @@ -12048,7 +12060,6 @@ static int XOTclObjectpropertyCmd(Tcl_Interp *interp, Tcl_Obj *obj, int objectkind) { int success = TCL_ERROR; XOTclObject *object; - XOTclClass *cl; /* fprintf(stderr, "XOTclObjectpropertyCmd\n");*/ Index: library/lib/doc-tools.tcl =================================================================== diff -u -r5f765b6d8713f416a443cc2367c3a47903cc2f83 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 5f765b6d8713f416a443cc2367c3a47903cc2f83) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -237,7 +237,7 @@ # @return The identifier of the newly generated or resolved entity object # @see {{@method id}} namespace eval $id {} - if {[::nsf::objectproperty $id object]} { + if {[::nsf::isobject $id]} { $id configure {*}$args } else { :create $id {*}$args @@ -403,9 +403,9 @@ if {$use ne ""} { foreach thing {@command @object} { set docobj [$thing id $use] - if {[::nsf::objectproperty $docobj object]} break + if {[::nsf::isobject $docobj]} break } - if {[::nsf::objectproperty $docobj object]} { + if {[::nsf::isobject $docobj]} { if {![$docobj eval [list info exists :$what]]} {error "no attribute $what in $docobj"} set names [list] foreach v [$docobj $what] { @@ -607,7 +607,7 @@ :method undocumented {} { # TODO: for object methods and class methods - if {![::nsf::objectproperty ${:name} object]} {return ""} + if {![::nsf::isobject ${:name}]} {return ""} foreach m [${:name} info methods] {set available_method($m) 1} set methods ${:@method} if {[info exists :@param]} {set methods [concat ${:@method} ${:@param}]} @@ -719,7 +719,7 @@ # documentaion quality check: is documentation in sync with implementation? # TODO: make me conditional, MARKUP should be in templates set object [${:partof} name] - if {[::nsf::objectproperty $object object]} { + if {[::nsf::isobject $object]} { if {[$object info methods ${:name}] ne ""} { set actualParams "" if {[$object info method type ${:name}] eq "forward"} { @@ -1222,7 +1222,7 @@ # :method process {{-noeval false} thing args} { # 1) in-situ processing: a class object - if {[::nsf::objectproperty $thing object]} { + if {[::nsf::isobject $thing]} { if {[$thing eval {info exists :__initcmd}]} { :analyze_initcmd [expr {[::nsf::objectproperty $thing class]?"@class":"@object"}] $thing [$thing eval {set :__initcmd}] Index: library/lib/test.tcl =================================================================== diff -u -r4a27d9aef2dbddc2257c9716a774c4f1662afffb -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- library/lib/test.tcl (.../test.tcl) (revision 4a27d9aef2dbddc2257c9716a774c4f1662afffb) +++ library/lib/test.tcl (.../test.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -53,7 +53,7 @@ foreach o [Object info instances -closure] { if {[info exists pre_exist($o)]} continue #puts "must destroy $o" - if {[::nsf::objectproperty $o object]} {$o destroy} + if {[::nsf::isobject $o]} {$o destroy} } } } Index: library/nx/nx.tcl =================================================================== diff -u -rf1cd1537386ab1fdfabccaadae215990e376ae9d -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- library/nx/nx.tcl (.../nx.tcl) (revision f1cd1537386ab1fdfabccaadae215990e376ae9d) +++ library/nx/nx.tcl (.../nx.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -353,7 +353,7 @@ # Create dispatch/ensemble object and accessor method (if wanted) # if {$scope eq "Class"} { - if {![::nsf::objectproperty ${object}::slot object]} { + if {![::nsf::isobject ${object}::slot]} { ::nsf::methodproperty $object [Object create ${object}::slot] protected true if {$verbose} {puts stderr "... create object ${object}::slot"} } @@ -704,7 +704,7 @@ proc ::nx::slotObj {baseObject {name ""}} { # Create slot parent object if needed set slotParent ${baseObject}::slot - if {![::nsf::objectproperty $slotParent object]} { + if {![::nsf::isobject $slotParent]} { ::nx::Object alloc $slotParent ::nsf::methodproperty ${baseObject} -per-object slot protected true } @@ -1394,7 +1394,7 @@ # value contains no globbing meta characters, but elementtype is given if {[string first :: $value] == -1} { # get fully qualified name - if {![::nsf::objectproperty $value object]} { + if {![::nsf::isobject $value]} { error "$value does not appear to be an object" } set value [::nsf::dispatch $value -objscope ::nsf::current object] @@ -1794,7 +1794,7 @@ :protected method init {} { :public method new {-childof args} { ::nsf::importvar [::nsf::current class] {container object} withclass - if {![::nsf::objectproperty $object object]} { + if {![::nsf::isobject $object]} { $withclass create $object } ::nsf::next -childof $object {*}$args @@ -1817,7 +1817,7 @@ cmds } { if {![info exists object]} {set object [::nsf::current object]} - if {![::nsf::objectproperty $object object]} {$class create $object} + if {![::nsf::isobject $object]} {$class create $object} # reused in XOTcl, no "require" there, so use nsf primitiva ::nsf::dispatch $object ::nsf::cmd::Object::requireNamespace if {$withnew} { @@ -1853,7 +1853,7 @@ lappend :targetList $t #puts stderr "COPY makeTargetList $t target= ${:targetList}" # if it is an object without namespace, it is a leaf - if {[::nsf::objectproperty $t object]} { + if {[::nsf::isobject $t]} { if {[::nsf::dispatch $t ::nsf::cmd::ObjectInfo2::hasnamespace]} { # make target list from all children set children [$t info children] @@ -1865,7 +1865,7 @@ # now append all namespaces that are in the obj, but that # are not objects foreach c [namespace children $t] { - if {![::nsf::objectproperty $c object]} { + if {![::nsf::isobject $c]} { lappend children [namespace children $t] } } @@ -1892,7 +1892,7 @@ #puts stderr "COPY will copy targetList = [set :targetList]" foreach origin [set :targetList] { set dest [:getDest $origin] - if {[::nsf::objectproperty $origin object]} { + if {[::nsf::isobject $origin]} { # copy class information if {[::nsf::objectproperty $origin class]} { set cl [[$origin info class] create $dest -noinit] Index: library/serialize/serializer.tcl =================================================================== diff -u -rf1cd1537386ab1fdfabccaadae215990e376ae9d -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision f1cd1537386ab1fdfabccaadae215990e376ae9d) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -183,7 +183,7 @@ return 1 } # we do this for object trees without object-less namespaces - if {![::nsf::objectproperty $o object]} { + if {![::nsf::isobject $o]} { return 0 } set o [$o info parent] @@ -275,7 +275,7 @@ catch {unset namespace(::ns)} foreach ns [array name namespace] { if {![namespace exists $ns]} continue - if {![::nsf::objectproperty $ns object]} { + if {![::nsf::isobject $ns]} { append pre_cmds "namespace eval $ns {}\n" } elseif {$ns ne [namespace origin $ns] } { append pre_cmds "namespace eval $ns {}\n" @@ -342,7 +342,7 @@ :object method checkExportedObject {} { foreach o [array names :exportObjects] { - if {![::nsf::objectproperty $o object]} { + if {![::nsf::isobject $o]} { puts stderr "Serializer exportObject: ignore non-existing object $o" unset :exportObjects($o) } else { @@ -494,14 +494,14 @@ # foreach k [Serializer exportedMethods] { foreach {o p m} $k break - if {![::nsf::objectproperty $o object]} { + if {![::nsf::isobject $o]} { puts stderr "Warning: $o is not an object" } elseif {[::nsf::dispatch $o ::nsf::cmd::ObjectInfo2::hastype ${:rootClass}]} { set :exportMethods($k) 1 } } foreach o [Serializer exportedObjects] { - if {![::nsf::objectproperty $o object]} { + if {![::nsf::isobject $o]} { puts stderr "Warning: $o is not an object" } elseif {[nsf::dispatch $o ::nsf::cmd::ObjectInfo2::hastype ${:rootClass}]} { set :exportObjects($o) 1 Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r39952278bc1e3aa6dda5df7cbe4cffc399f63b98 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 39952278bc1e3aa6dda5df7cbe4cffc399f63b98) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -475,7 +475,7 @@ :alias forward ::nsf::cmd::ObjectInfo2::forward :alias hasnamespace ::nsf::cmd::ObjectInfo2::hasnamespace :proc invar {} {::nsf::assertion [self] object-invar} - #:proc is {kind value:optional} {::nsf::objectproperty [::nsf::current object] $kind {*}$value} + #:proc is {kind} {::nsf::objectproperty [::nsf::current object] $kind} :proc methods { -nocmds:switch -noprocs:switch -incontext:switch pattern:optional @@ -590,7 +590,7 @@ Object instproc alias {} {} # emulation of isobject, isclass ... - Object instproc isobject {{object:substdefault "[self]"}} {::nsf::objectproperty $object object} + Object instproc isobject {{object:substdefault "[self]"}} {::nsf::isobject $object} Object instproc isclass {{class:substdefault "[self]"}} {::nsf::objectproperty $class class} Object instproc ismetaclass {{class:substdefault "[self]"}} {::nsf::objectproperty $class metaclass} Object instproc ismixin {class} { Index: tests/destroytest.tcl =================================================================== diff -u -r1a67ad0bf0b5c2092e1558d13659bad489f5bb75 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- tests/destroytest.tcl (.../destroytest.tcl) (revision 1a67ad0bf0b5c2092e1558d13659bad489f5bb75) +++ tests/destroytest.tcl (.../destroytest.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -27,18 +27,18 @@ C method foo {} { puts stderr "==== $::case [current]" :destroy - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nsf::isobject c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] -? {::nsf::objectproperty c1 object} 0 "$::case object deleted" +puts stderr ======[::nsf::isobject c1] +? {::nsf::isobject c1} 0 "$::case object deleted" ? "set ::firstDestroy" 1 "firstDestroy called" @@ -52,18 +52,18 @@ C method foo {} { puts stderr "==== $::case [current]" :destroy - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nsf::isobject c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] -? {::nsf::objectproperty c1 object} 1 "$::case object deleted" +puts stderr ======[::nsf::isobject c1] +? {::nsf::isobject c1} 1 "$::case object deleted" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -77,18 +77,18 @@ C method foo {} { puts stderr "==== $::case [current]" [:info class] create [current] - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nsf::isobject c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] -? {::nsf::objectproperty c1 object} 1 "$::case object deleted" +puts stderr ======[::nsf::isobject c1] +? {::nsf::isobject c1} 1 "$::case object deleted" ? "set ::firstDestroy" 0 "firstDestroy called" # @@ -103,18 +103,18 @@ C method foo {} { puts stderr "==== $::case [current]" rename [current] "" - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nsf::isobject c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] -? {::nsf::objectproperty c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nsf::isobject c1] +? {::nsf::isobject c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -130,19 +130,19 @@ C method foo {} { puts stderr "==== $::case [current]" rename [current] "" - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nsf::isobject c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] +puts stderr ======[::nsf::isobject c1] puts stderr ======[c1 set x] -? {::nsf::objectproperty c1 object} 1 "$::case object still exists after proc" +? {::nsf::isobject c1} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -158,18 +158,18 @@ C method foo {} { puts stderr "==== $::case [current]" rename o [current] - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nsf::isobject c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] -? {::nsf::objectproperty c1 object} 1 "$::case object still exists after proc" +puts stderr ======[::nsf::isobject c1] +? {::nsf::isobject c1} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -189,7 +189,7 @@ } C create c1 c1 foo -? {::nsf::objectproperty c1 object} 1 "$::case object still exists after proc" +? {::nsf::isobject c1} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -209,28 +209,28 @@ C method foo {} { puts stderr "==== $::case [current]" namespace delete ::test - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 # # If the following line is commented in, the namespace is deleted # here. Is there a bug with nsPtr->activationCount # #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - puts stderr "???? [current] exists [::nsf::objectproperty [current] object]" - ? "::nsf::objectproperty [current] object" 0 ;# WHY? - puts stderr "???? [current] exists [::nsf::objectproperty [current] object]" + puts stderr "???? [current] exists [::nsf::isobject [current]]" + ? "::nsf::isobject [current]" 0 ;# WHY? + puts stderr "???? [current] exists [::nsf::isobject [current]]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "$::case destroy not yet called" } } test::C create test::c1 test::c1 foo -puts stderr ======[::nsf::objectproperty test::c1 object] -? {::nsf::objectproperty test::c1 object} 0 "object still exists after proc" +puts stderr ======[::nsf::isobject test::c1] +? {::nsf::isobject test::c1} 0 "object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "destroy was called when poping stack frame" -? {::nsf::objectproperty ::test::C object} 0 "class still exists after proc" +? {::nsf::isobject ::test::C} 0 "class still exists after proc" ? {namespace exists ::test::C} 0 "namespace ::test::C still exists after proc" ? {namespace exists ::test} 1 "parent ::test namespace still exists after proc" ? {namespace exists ::xotcl::classes::test::C} 0 "namespace ::xotcl::classes::test::C still exists after proc" @@ -249,25 +249,25 @@ C method foo {} { puts stderr "==== $::case [current]" namespace delete ::test - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 # # If the following line is commented in, the namespace is deleted # here. Is there a bug with nsPtr->activationCount # #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - puts stderr "???? [current] exists [::nsf::objectproperty [current] object]" - ? "::nsf::objectproperty [current] object" 0 "$::case object still exists in proc";# WHY? - puts stderr "???? [current] exists [::nsf::objectproperty [current] object]" + puts stderr "???? [current] exists [::nsf::isobject [current]]" + ? "::nsf::isobject [current]" 0 "$::case object still exists in proc";# WHY? + puts stderr "???? [current] exists [::nsf::isobject [current]]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called"; # NOT YET CALLED } } test::C create test::c1 test::c1 foo -puts stderr ======[::nsf::objectproperty test::c1 object] -? {::nsf::objectproperty test::c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nsf::isobject test::c1] +? {::nsf::isobject test::c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" ;# toplevel destroy was blocked @@ -287,20 +287,20 @@ puts stderr "AAAA" # the following isobject call has a problem in Tcl_GetCommandFromObj(), # which tries to access invalid memory - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::objectproperty ::o::c1 object} 0 "$::case object still exists in proc" + ? {::nsf::isobject ::o::c1} 0 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create o::c1 o::c1 foo -puts stderr ======[::nsf::objectproperty ::o::c1 object] -? {::nsf::objectproperty ::o::c1 object} 0 "$::case object o::c1 still exists after proc" -? {::nsf::objectproperty o object} 0 "$::case object o still exists after proc" +puts stderr ======[::nsf::isobject ::o::c1] +? {::nsf::isobject ::o::c1} 0 "$::case object o::c1 still exists after proc" +? {::nsf::isobject o} 0 "$::case object o still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -317,18 +317,18 @@ C method foo {} { puts stderr "==== $::case [current]" o destroy - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::objectproperty ::o::c1 object} 0 "$::case object still exists in proc" + ? {::nsf::isobject ::o::c1} 0 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create o::c1 o::c1 foo -puts stderr ======[::nsf::objectproperty ::o::c1 object] -? {::nsf::objectproperty ::o::c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nsf::isobject ::o::c1] +? {::nsf::isobject ::o::c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -345,18 +345,18 @@ C method foo {} { puts stderr "==== $::case [current]" proc [current] {args} {puts HELLO} - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" - ? {::nsf::objectproperty c1 object} 0 "$::case object still exists in proc" + ? {::nsf::isobject c1} 0 "$::case object still exists in proc" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] -? {::nsf::objectproperty c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nsf::isobject c1] +? {::nsf::isobject c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -372,22 +372,22 @@ C method foo {} { puts stderr "==== $::case [current]" C destroy - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" #? [:info class] ::xotcl::Object "object reclassed" ? [:info class] ::C "object reclassed?" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" - ? {::nsf::objectproperty c1 object} 1 "object still exists in proc" + ? {::nsf::isobject c1} 1 "object still exists in proc" #? {::nsf::objectproperty ::C class} 0 "class still exists in proc" ? {::nsf::objectproperty ::C class} 1 "class still exists in proc" } C create c1 c1 foo -puts stderr ======[::nsf::objectproperty c1 object] -? {::nsf::objectproperty c1 object} 1 "object still exists after proc" +puts stderr ======[::nsf::isobject c1] +? {::nsf::isobject c1} 1 "object still exists after proc" ? [c1 info class] ::nx::Object "after proc: object reclassed?" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -402,7 +402,7 @@ C method foo {} { puts stderr "==== $::case [current]" C destroy - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" @@ -412,13 +412,13 @@ ? "set ::ObjectDestroy" 1 "ObjectDestroy called" ? [:info class] ::C "object reclassed" #? [:info class] ::xotcl::Object "object reclassed" - ? {::nsf::objectproperty ::C::c1 object} 1 "object still exists in proc" + ? {::nsf::isobject ::C::c1} 1 "object still exists in proc" ? {::nsf::objectproperty ::C class} 1 "class still exists in proc" } C create ::C::c1 C::c1 foo -#puts stderr ======[::nsf::objectproperty ::C::c1 object] -? {::nsf::objectproperty ::C::c1 object} 0 "object still exists after proc" +#puts stderr ======[::nsf::isobject ::C::c1] +? {::nsf::isobject ::C::c1} 0 "object still exists after proc" ? {::nsf::objectproperty ::C class} 0 "class still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -428,8 +428,8 @@ Object create x Object create x::y x destroy - ? {::nsf::objectproperty x object} 0 "parent object gone" - ? {::nsf::objectproperty x::y object} 0 "child object gone" + ? {::nsf::isobject x} 0 "parent object gone" + ? {::nsf::isobject x::y} 0 "child object gone" } Test case deleting-aliased-object { @@ -457,18 +457,18 @@ Object create o3 ::nsf::alias o x o3 o destroy -? {::nsf::objectproperty o object} 0 "parent object gone" -? {::nsf::objectproperty o3 object} 1 "aliased object still here" +? {::nsf::isobject o} 0 "parent object gone" +? {::nsf::isobject o3} 1 "aliased object still here" o3 destroy -? {::nsf::objectproperty o3 object} 0 "aliased object destroyed" +? {::nsf::isobject o3} 0 "aliased object destroyed" set case "create an alias, and delete cmd via aggregation" Test case create-alias-delete-via-aggregation Object create o Object create o3 ::nsf::alias o x o3 o::x destroy -? {::nsf::objectproperty o3 object} 0 "aliased object destroyed" +? {::nsf::isobject o3} 0 "aliased object destroyed" o destroy # @@ -517,8 +517,8 @@ C alias b o C create c1 C destroy - ? {::nsf::objectproperty o object} 1 "object o still here" - ? {::nsf::objectproperty o3 object} 1 "object o3 still here" + ? {::nsf::isobject o} 1 "object o still here" + ? {::nsf::isobject o3} 1 "object o3 still here" } # @@ -553,23 +553,23 @@ } ? {::nsf::objectproperty ::module::Foo class} 1 ? {::nsf::objectproperty ::module::foo class} 0 - ? {::nsf::objectproperty ::module::foo object} 1 + ? {::nsf::isobject ::module::foo} 1 ? {::nsf::objectproperty ::module class} 1 Object create ::o { :require namespace } namespace eval ::o {namespace import ::module::*} ? {::nsf::objectproperty ::o::Foo class} 1 - ? {::nsf::objectproperty ::o::foo object} 1 + ? {::nsf::isobject ::o::foo} 1 # do not destroy namespace imported objects/classes ::o destroy ? {::nsf::objectproperty ::o::Foo class} 0 - ? {::nsf::objectproperty ::o::foo object} 0 + ? {::nsf::isobject ::o::foo} 0 ? {::nsf::objectproperty ::module::Foo class} 1 - ? {::nsf::objectproperty ::module::foo object} 1 + ? {::nsf::isobject ::module::foo} 1 ::module destroy } @@ -583,28 +583,28 @@ C method foo {} { puts stderr "==== $::case [current]" namespace delete ::test - puts stderr "AAAA [current] exists [::nsf::objectproperty [current] object]" + puts stderr "AAAA [current] exists [::nsf::isobject [current]]" :set x 1 # # If the following line is commented in, the namespace is deleted # here. Is there a bug with nsPtr->activationCount # #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - puts stderr "???? [current] exists [::nsf::objectproperty [current] object]" - ? "::nsf::objectproperty [current] object" 0 ;# WHY? - puts stderr "???? [current] exists [::nsf::objectproperty [current] object]" + puts stderr "???? [current] exists [::nsf::isobject [current]]" + ? "::nsf::isobject [current]" 0 ;# WHY? + puts stderr "???? [current] exists [::nsf::isobject [current]]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "$::case destroy not yet called" } } test::C create test::c1 test::c1 foo -puts stderr ======[::nsf::objectproperty test::c1 object] -? {::nsf::objectproperty test::c1 object} 0 "object still exists after proc" +puts stderr ======[::nsf::isobject test::c1] +? {::nsf::isobject test::c1} 0 "object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "destroy was called when poping stack frame" -? {::nsf::objectproperty ::test::C object} 0 "class still exists after proc" +? {::nsf::isobject ::test::C} 0 "class still exists after proc" ? {namespace exists ::test::C} 0 "namespace ::test::C still exists after proc" ? {namespace exists ::test} 1 "parent ::test namespace still exists after proc" ? {namespace exists ::xotcl::classes::test::C} 0 "namespace ::xotcl::classes::test::C still exists after proc" Index: tests/object-system.tcl =================================================================== diff -u -rf3cb5afe6aa1b6761b4a9909058f64ff7d64ab92 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- tests/object-system.tcl (.../object-system.tcl) (revision f3cb5afe6aa1b6761b4a9909058f64ff7d64ab92) +++ tests/object-system.tcl (.../object-system.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -16,21 +16,21 @@ } } -? {::nsf::objectproperty Object object} 1 +? {::nsf::isobject Object} 1 ? {::nsf::objectproperty Object class} 1 ? {::nsf::objectproperty Object metaclass} 0 ? {Object info superclass} "" ? {Object info class} ::nx::Class -? {::nsf::objectproperty Class object} 1 +? {::nsf::isobject Class} 1 ? {::nsf::objectproperty Class class} 1 ? {::nsf::objectproperty Class metaclass} 1 ? {Class info superclass} ::nx::Object ? {Class info class} ::nx::Class Object create o -? {::nsf::objectproperty Object object} 1 +? {::nsf::isobject Object} 1 ? {::nsf::objectproperty o class} 0 ? {::nsf::objectproperty o metaclass} 0 ? {o info class} ::nx::Object @@ -45,27 +45,27 @@ #? {lsort [Class info vars]} "__default_metaclass __default_superclass" Class create M -superclass ::nx::Class -? {::nsf::objectproperty M object} 1 +? {::nsf::isobject M} 1 ? {::nsf::objectproperty M class} 1 ? {::nsf::objectproperty M metaclass} 1 ? {M info superclass} ::nx::Class ? {M info class} ::nx::Class M create C -? {::nsf::objectproperty C object} 1 +? {::nsf::isobject C} 1 ? {::nsf::objectproperty C class} 1 ? {::nsf::objectproperty C metaclass} 0 ? {C info superclass} ::nx::Object ? {C info class} ::M C create c1 -? {::nsf::objectproperty c1 object} 1 +? {::nsf::isobject c1} 1 ? {::nsf::objectproperty c1 class} 0 ? {::nsf::objectproperty c1 metaclass} 0 ? {c1 info class} ::C Class create M2 -superclass M -? {::nsf::objectproperty M2 object} 1 +? {::nsf::isobject M2} 1 ? {::nsf::objectproperty M2 class} 1 ? {::nsf::objectproperty M2 metaclass} 1 ? {M2 info superclass} ::M @@ -78,7 +78,7 @@ # destroy meta-class M, reclass meta-class instances to the base # meta-class and set subclass of M to the root meta-class M destroy -? {::nsf::objectproperty C object} 1 +? {::nsf::isobject C} 1 ? {::nsf::objectproperty C class} 1 ? {::nsf::objectproperty C metaclass} 0 ? {C info superclass} ::nx::Object @@ -100,16 +100,16 @@ # basic parameter tests Class create C -parameter {{x 1} {y 2}} -? {::nsf::objectproperty C object} 1 -? {::nsf::objectproperty C::slot object} 1 +? {::nsf::isobject C} 1 +? {::nsf::isobject C::slot} 1 ? {C info children} ::C::slot C copy X -? {::nsf::objectproperty X object} 1 +? {::nsf::isobject X} 1 ? {X info vars} "" ? {C info vars} "" -? {::nsf::objectproperty X::slot object} 1 +? {::nsf::isobject X::slot} 1 #? {C::slot info vars} __parameter ? {C info parameter} {{x 1} {y 2}} @@ -146,13 +146,13 @@ # create a minimal object system without internally dipatched methods ::nsf::createobjectsystem ::object ::class -? {::nsf::objectproperty ::object object} 1 +? {::nsf::isobject ::object} 1 ? {::nsf::objectproperty ::object class} 1 ? {::nsf::objectproperty ::object metaclass} 0 ? {::nsf::relation ::object class} ::class ? {::nsf::relation ::object superclass} "" -? {::nsf::objectproperty ::class object} 1 +? {::nsf::isobject ::class} 1 ? {::nsf::objectproperty ::class class} 1 ? {::nsf::objectproperty ::class metaclass} 1 ? {::nsf::relation ::class class} ::class @@ -165,7 +165,7 @@ # create a class named C ::class + C -? {::nsf::objectproperty ::C object} 1 +? {::nsf::isobject ::C} 1 ? {::nsf::objectproperty ::C class} 1 ? {::nsf::objectproperty ::C metaclass} 0 ? {::nsf::relation ::C class} ::class @@ -174,15 +174,15 @@ # create an instance of C C + c1 -? {::nsf::objectproperty ::c1 object} 1 +? {::nsf::isobject ::c1} 1 ? {::nsf::objectproperty ::c1 class} 0 ? {::nsf::objectproperty ::c1 metaclass} 0 ? {::nsf::relation ::c1 class} ::C # destroy instance and class c1 - -? {::nsf::objectproperty ::c1 object} 0 +? {::nsf::isobject ::c1} 0 ? {::nsf::objectproperty ::C class} 1 C - Index: tests/parameters.tcl =================================================================== diff -u -r39952278bc1e3aa6dda5df7cbe4cffc399f63b98 -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- tests/parameters.tcl (.../parameters.tcl) (revision 39952278bc1e3aa6dda5df7cbe4cffc399f63b98) +++ tests/parameters.tcl (.../parameters.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -7,9 +7,9 @@ set o [Object create o] puts o=$o - ? {::nsf::objectproperty ::o object} 1 + ? {::nsf::isobject ::o} 1 } -? {::nsf::objectproperty ::o object} 0 +? {::nsf::isobject ::o} 0 #exit ####################################################### @@ -36,8 +36,8 @@ ? {c1 info has mixin ::M1} {expected class but got "::M1" for parameter class} #? {::nsf::parametercheck hasmixin,arg=::M c1} 1 - ? {::nsf::objectproperty o1 object} 1 - ? {::nsf::objectproperty o1000 object} 0 + ? {::nsf::isobject o1} 1 + ? {::nsf::isobject o1000} 0 #? {::nsf::objectproperty c1 type C} 1 ? {c1 info has type C} 1 Index: tests/varresolutiontest.tcl =================================================================== diff -u -r915842c26db98121eb7ed1c6adfbe499ce586cac -r18122dd21b99cf0d5b4cd01635048641a23aa051 --- tests/varresolutiontest.tcl (.../varresolutiontest.tcl) (revision 915842c26db98121eb7ed1c6adfbe499ce586cac) +++ tests/varresolutiontest.tcl (.../varresolutiontest.tcl) (revision 18122dd21b99cf0d5b4cd01635048641a23aa051) @@ -406,7 +406,7 @@ ::C create ::c namespace eval ::c {} ? {namespace exists ::c} 1 -? {::nsf::objectproperty ::c object} 1 +? {::nsf::isobject ::c} 1 ? {::c info has namespace} 0 ? {::c Set w 2; expr {[::c Set w] == $::w}} 0