Index: TODO =================================================================== diff -u -r211c77c1a94a47be185a8bfb12c89512937b1901 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- TODO (.../TODO) (revision 211c77c1a94a47be185a8bfb12c89512937b1901) +++ TODO (.../TODO) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -2621,7 +2621,10 @@ - renamed NsfNoDispatchObjectError() to NsfDispatchClientDataError(), extended interface - Makefile.in: fixed name methods.test +- nsf: renamed nsf::isobject to nsf::object::exists +- nsf: renamed nsf::qualify to nsf::object::qualify + TODO: - the scripted init block is called before init. If the default Index: doc/next-migration.html =================================================================== diff -u -re81c69e53c56a298227bc9e349ff6918d03ef94a -rda6586782390b02ed7660b56417c3db00d63d1c3 --- doc/next-migration.html (.../next-migration.html) (revision e81c69e53c56a298227bc9e349ff6918d03ef94a) +++ doc/next-migration.html (.../next-migration.html) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -2707,7 +2707,7 @@ # a class /cls/ mixin ... -/cls/ mixin guard /mixin/ ?condition? +/cls/ mixin guard /mixin/ ?condition?
@@ -2722,7 +2722,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
/cls/ mixin ...
-/cls/ mixin guard /mixin/ ?condition?
+/cls/ mixin guard /mixin/ ?condition?
-
/cls/ info methods ?pattern?
+
/cls/ info methods ?pattern?
@@ -2973,7 +2973,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype setter ?pattern?
+
/cls/ info methods -methodtype setter ?pattern?
@@ -2999,7 +2999,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype scripted ?pattern?
+
/cls/ info methods -methodtype scripted ?pattern?
@@ -3025,7 +3025,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype alias ?pattern?
+
/cls/ info methods -methodtype alias ?pattern?
@@ -3051,7 +3051,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype forwarder ?pattern?
+
/cls/ info methods -methodtype forwarder ?pattern?
@@ -3077,7 +3077,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype object ?pattern?
+
/cls/ info methods -methodtype object ?pattern?
@@ -3103,7 +3103,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -callprotection public|protected ...
+
/cls/ info methods -callprotection public|protected ...
@@ -3153,7 +3153,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods ?pattern?
+
/obj/ info methods ?pattern?
@@ -3179,7 +3179,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods -methodtype setter ?pattern?
+
/obj/ info methods -methodtype setter ?pattern?
@@ -3205,7 +3205,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods -methodtype scripted ?pattern?
+
/obj/ info methods -methodtype scripted ?pattern?
@@ -3231,7 +3231,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods -methodtype alias ?pattern?
+
/obj/ info methods -methodtype alias ?pattern?
@@ -3257,7 +3257,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods -methodtype forwarder ?pattern?
+
/obj/ info methods -methodtype forwarder ?pattern?
@@ -3283,7 +3283,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods -methodtype object ?pattern?
+
/obj/ info methods -methodtype object ?pattern?
@@ -3309,7 +3309,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods -callprotection public|protected ...
+
/obj/ info methods -callprotection public|protected ...
@@ -3358,7 +3358,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info methods ?pattern?
+
/cls/ class info methods ?pattern?
@@ -3384,7 +3384,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info methods -methodtype setter ?pattern?
+
/cls/ class info methods -methodtype setter ?pattern?
@@ -3410,7 +3410,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info methods -methodtype scripted ?pattern?
+
/cls/ class info methods -methodtype scripted ?pattern?
@@ -3436,7 +3436,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info methods -methodtype alias ?pattern?
+
/cls/ class info methods -methodtype alias ?pattern?
@@ -3462,7 +3462,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info methods -methodtype forwarder ?pattern?
+
/cls/ class info methods -methodtype forwarder ?pattern?
@@ -3488,7 +3488,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info methods -methodtype object ?pattern?
+
/cls/ class info methods -methodtype object ?pattern?
@@ -3514,7 +3514,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info methods \
+
/cls/ class info methods \
    -callprotection public|protected ...
@@ -3569,7 +3569,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
/obj/ info method exists /methodName/
-/obj/ info methods /methodName/
+/obj/ info methods /methodName/
@@ -3596,7 +3596,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
/cls/ ?class? info method exists /methodName/
-/cls/ ?class? info methods /methodName/
+/cls/ ?class? info methods /methodName/ @@ -3634,7 +3634,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info methods ?pattern?
+
/obj/ info methods ?pattern?
-
/obj/ info lookup methods ... ?pattern?
+
/obj/ info lookup methods ... ?pattern?
 # Returns list of method names
@@ -3674,7 +3674,7 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
# List only application specific methods
-/obj/ info lookup methods -source application ... ?pattern?
+/obj/ info lookup methods -source application ... ?pattern?
 # Returns list of method names
@@ -3737,8 +3737,8 @@ .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;}
# List slot objects defined for obj
-/obj/ info lookup slots
-# Returns list of slot objects
+/obj/ info lookup slots ?-type /type/? +# Returns list of slot objects of specified type (class) @@ -3790,7 +3790,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info lookup method /methodName/
+
/obj/ info lookup method /methodName/
 # Returns method-handle
@@ -3817,7 +3817,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info lookup filter /methodName/
+
/obj/ info lookup filter /methodName/
 # Returns method-handle
@@ -4344,7 +4344,7 @@ # method-handles instead of triples # (applies to all three variants) -/obj/ info filter methods \ +/obj/ info filter methods \ ?-guards? ?-order? ?pattern?
@@ -4371,7 +4371,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info filter guard /name/
+
/obj/ info filter guard /name/
@@ -4397,7 +4397,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info filter methods \
+
/cls/ class info filter methods \
    ?-guards? ?-order? ?pattern?
@@ -4424,7 +4424,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info filter guard /name/
+
/cls/ class info filter guard /name/
@@ -4451,7 +4451,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info filter methods \
+
/cls/ info filter methods \
    ?-guards? ?-order? ?pattern?
@@ -4478,7 +4478,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info filter guard /name/
+
/cls/ info filter guard /name/
@@ -4531,7 +4531,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info mixin guard /name/
+
/obj/ info mixin guard /name/
@@ -4584,7 +4584,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ class info mixin guard /name/
+
/cls/ class info mixin guard /name/
@@ -4638,7 +4638,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info mixin guard /name/
+
/cls/ info mixin guard /name/
@@ -5148,7 +5148,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ isobject /obj/
+
/obj/ object::exists /obj/
-
::nsf::isobject /obj/
+
::nsf::object::exists /obj/
@@ -6021,7 +6021,7 @@ Index: doc/next-migration.txt =================================================================== diff -u -r65abda7763aa24fe8a33728195cc3043d06ee660 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- doc/next-migration.txt (.../next-migration.txt) (revision 65abda7763aa24fe8a33728195cc3043d06ee660) +++ doc/next-migration.txt (.../next-migration.txt) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -2183,11 +2183,11 @@ ---------------- |[source,tcl] ---------------- -/obj/ isobject /obj/ +/obj/ object::exists /obj/ ---------------- |[source,tcl] ---------------- -::nsf::isobject /obj/ +::nsf::object::exists /obj/ ---------------- |====================== Index: generic/aol-xotcl.tcl =================================================================== diff -u -r92e6424562685bcc3665bf23dfcdc3ee489c25ef -rda6586782390b02ed7660b56417c3db00d63d1c3 --- generic/aol-xotcl.tcl (.../aol-xotcl.tcl) (revision 92e6424562685bcc3665bf23dfcdc3ee489c25ef) +++ generic/aol-xotcl.tcl (.../aol-xotcl.tcl) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -34,7 +34,7 @@ foreach n $namespaces { if {$n ne "::nsf" && $n ne "::xotcl" && $n ne "::nx" && ![string match "::nsf::*" $n] - && ![::nsf::isobject $n]} { + && ![::nsf::object::exists $n]} { lappend nslist $n } } Index: generic/gentclAPI.decls =================================================================== diff -u -rb01ae78fb55550ee1ce97f2c8c69a07535190411 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision b01ae78fb55550ee1ce97f2c8c69a07535190411) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -53,9 +53,6 @@ {-argName "constraint" -required 1 -type tclobj} {-argName "value" -required 1 -type tclobj} } -cmd isobject NsfIsObjectCmd { - {-argName "value" -required 1 -type tclobj} -} cmd "method::alias" NsfAliasCmd { {-argName "object" -required 1 -type object} @@ -129,7 +126,10 @@ {-argName "fromNs" -required 1 -type tclobj} {-argName "toNs" -required 1 -type tclobj} } -cmd qualify NsfQualifyObjCmd { +cmd "object::exists" NsfIsObjectCmd { + {-argName "value" -required 1 -type tclobj} +} +cmd "object::qualify" NsfQualifyObjCmd { {-argName "objectName" -required 1 -type tclobj} } cmd relation NsfRelationCmd { Index: generic/tclAPI.h =================================================================== diff -u -r211c77c1a94a47be185a8bfb12c89512937b1901 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- generic/tclAPI.h (.../tclAPI.h) (revision 211c77c1a94a47be185a8bfb12c89512937b1901) +++ generic/tclAPI.h (.../tclAPI.h) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -2292,7 +2292,7 @@ {"constraint", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"value", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::isobject", NsfIsObjectCmdStub, 1, { +{"::nsf::object::exists", NsfIsObjectCmdStub, 1, { {"value", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::method::create", NsfMethodCmdStub, 8, { @@ -2340,7 +2340,7 @@ {"::nsf::__profile_get", NsfProfileGetDataStubStub, 0, { {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::qualify", NsfQualifyObjCmdStub, 1, { +{"::nsf::object::qualify", NsfQualifyObjCmdStub, 1, { {"objectName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::relation", NsfRelationCmdStub, 3, { Index: library/lib/doc-tools.tcl =================================================================== diff -u -rb3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b -rda6586782390b02ed7660b56417c3db00d63d1c3 --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision b3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -143,7 +143,7 @@ } foreach mixin [:info children -type [current class]::Mixin] { set base "${:prefix}::[namespace tail $mixin]" - if {[::nsf::isobject $base]} { + if {[::nsf::object::exists $base]} { set scope [expr {[$mixin scope] eq "object" && \ [$base info is class]?"class-object":""}] dict lappend :active_mixins $base $mixin @@ -230,7 +230,7 @@ # # TODO interp-aliasing objects under different command names # is currently not transparent to some ::nsf::* helpers, - # such as ::nsf::isobject. Should this be changed? + # such as ::nsf::object::exists. Should this be changed? # if {$cmd ne ""} { set cmd [namespace origin $cmd] @@ -239,12 +239,12 @@ set cmd $target } } - if {$cmd eq "" || ![::nsf::isobject $cmd] || ![$cmd info has type Tag]} { + if {$cmd eq "" || ![::nsf::object::exists $cmd] || ![$cmd info has type Tag]} { return [list 1 "The entity type '@$axis' is not available."] } set entity [@$axis id $value] } else { - if {$strict && ![::nsf::isobject $entity]} { + if {$strict && ![::nsf::object::exists $entity]} { return [list 1 "The tag path '$tagpath' -> '$names' points to a non-existing documentation entity: '@$last_axis' -> '$last_name'"] } if {$all} {lappend entity_path $entity [$entity name]} @@ -259,7 +259,7 @@ } } - if {$strict && $entity ne "" && ![::nsf::isobject $entity]} { + if {$strict && $entity ne "" && ![::nsf::object::exists $entity]} { return [list 1 "The tag path '$tagpath' -> '$names' points to a non-existing documentation entity: '@$last_axis' -> '$last_name'"] } if {$all} {lappend entity_path $entity [$entity name]} @@ -318,7 +318,7 @@ :method createOrConfigure {id args} { namespace eval $id {} - if {[::nsf::isobject $id]} { + if {[::nsf::object::exists $id]} { $id configure {*}$args } else { :create $id {*}$args @@ -663,8 +663,8 @@ :public method origin {} { if {[info exists :@use]} { - #puts stderr ORIGIN(${:@use})=isobj-[::nsf::isobject ${:@use}] - if {![::nsf::isobject ${:@use}] || ![${:@use} info has type [:info class]]} { + #puts stderr ORIGIN(${:@use})=isobj-[::nsf::object::exists ${:@use}] + if {![::nsf::object::exists ${:@use}] || ![${:@use} info has type [:info class]]} { error "Referring to a non-existing doc entity or a doc entity of a different type." } return [${:@use} origin] @@ -919,8 +919,7 @@ # test environment more passive by checking for the existance # before calling destroy! # - if {[info exists :sandbox] && \ - [::nsf::isobject ${:sandbox}]} { + if {[info exists :sandbox] && [::nsf::object::exists ${:sandbox}]} { ${:sandbox} destroy } :current_project "" @@ -1073,7 +1072,7 @@ :method undocumented {} { # TODO: for object methods and class methods - if {![::nsf::isobject ${:name}]} {return ""} + if {![::nsf::object::exists ${:name}]} {return ""} foreach m [${:name} info methods -callprotection public] {set available_method($m) 1} set methods ${:@method} if {[info exists :@param]} {set methods [concat ${:@method} ${:@param}]} @@ -1514,7 +1513,7 @@ } set l [list] foreach item $r { - if {![::nsf::isobject $item] || ![$item info has type ::nx::doc::Entity]} { + if {![::nsf::object::exists $item] || ![$item info has type ::nx::doc::Entity]} { lappend l $item } else { if {[[$item origin] eval [list expr $where_clause]]} { @@ -2987,8 +2986,8 @@ foreach cmd [info commands $pattern] { if {![::nx::doc::is_exported $cmd]} continue; set type @command - if {[info commands "::nsf::isobject"] ne "" &&\ - [::nsf::isobject $cmd]} { + if {[info commands ::nsf::object::exists] ne "" &&\ + [::nsf::object::exists $cmd]} { set type [expr {[::nsf::is class $cmd]?"@class":"@object"}] } set imported_name [string trimright $ns :]::[namespace tail $cmd] @@ -3097,7 +3096,7 @@ # (which is not always the case). refactor the code # accordingly. set ::nx::doc::rootns [namespace qualifier $rootmclass] - if {[::nsf::isobject ${::nx::doc::rootns}::__Tracer]} { + if {[::nsf::object::exists ${::nx::doc::rootns}::__Tracer]} { ${::nx::doc::rootns}::__Tracer $sysmeths(-object.destroy) ::nsf::relation $rootmclass class-mixin {} } @@ -3351,7 +3350,7 @@ set prj [:current_project] if {$prj ne ""} { set box [$prj sandbox] - set script "if {\[::nsf::isobject $obj\]} {array set \"\" \[$obj eval {:__resolve_method_path \"$method_name\"}\]; ::nsf::dispatch \$(object) ::nsf::methods::${scope}::info::method handle \$(methodName)}" + set script "if {\[::nsf::object::exists $obj\]} {array set \"\" \[$obj eval {:__resolve_method_path \"$method_name\"}\]; ::nsf::dispatch \$(object) ::nsf::methods::${scope}::info::method handle \$(methodName)}" set cmdname [$box do $script] if {$cmdname ne "" && [$box eval [concat dict exists \${:registered_commands} $cmdname]]} { :pdata [$box eval [concat dict get \${:registered_commands} $cmdname]] @@ -4261,7 +4260,7 @@ # TODO interp-aliasing objects under different command names # is currently not transparent to some ::nsf::* helpers, - # such as ::nsf::isobject. Should this be changed? + # such as ::nsf::object::exists. Should this be changed? # if {$cmd ne ""} { set cmd [namespace origin $cmd] @@ -4271,7 +4270,7 @@ } } - if {$cmd eq "" || ![::nsf::isobject $cmd] || \ + if {$cmd eq "" || ![::nsf::object::exists $cmd] || \ ![$cmd info has type Tag]} { ${:block_parser} cancel INVALIDTAG "The entity type '@$leaf(axis)' is not available." @@ -4353,7 +4352,7 @@ :method parse@tag {line} { set r [next] # puts stderr GOT=$r - if {[::nsf::isobject $r] && [$r info has type ::nx::doc::Entity]} { + if {[::nsf::object::exists $r] && [$r info has type ::nx::doc::Entity]} { set :current_part $r } return $r Index: library/lib/test.tcl =================================================================== diff -u -rb3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b -rda6586782390b02ed7660b56417c3db00d63d1c3 --- library/lib/test.tcl (.../test.tcl) (revision b3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b) +++ library/lib/test.tcl (.../test.tcl) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -53,7 +53,7 @@ foreach o [Object info instances -closure] { if {[info exists pre_exist($o)]} continue #puts "must destroy $o" - if {[::nsf::isobject $o]} {$o destroy} + if {[::nsf::object::exists $o]} {$o destroy} } } } Index: library/mongodb/nx-mongo.tcl =================================================================== diff -u -r8f4ba2af8b01697a3aab727a2794cb3b456d6632 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision 8f4ba2af8b01697a3aab727a2794cb3b456d6632) +++ library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -162,7 +162,7 @@ :public method type=embedded {name value arg} { set s [:uplevel self] #puts stderr "check $name '$value' arg='$arg' s=$s" - if {[::nsf::isobject $value] && [::nsf::is class $arg] && [$value info has type $arg]} { + if {[::nsf::object::exists $value] && [::nsf::is class $arg] && [$value info has type $arg]} { ::nsf::var::set $value __embedded_in [list $s $name] ::nsf::var::set $s __contains($value) 1 } else { @@ -176,7 +176,7 @@ :public method type=reference {name value arg} { set s [:uplevel self] #puts stderr "check $name '$value' arg='$arg' s=$s" - if {[::nsf::isobject $value] && [::nsf::is class $arg] && [$value info has type $arg]} { + if {[::nsf::object::exists $value] && [::nsf::is class $arg] && [$value info has type $arg]} { set ref [list $s $name] if {[::nsf::var::exists $value __referenced_in]} { set refs [::nsf::var::set $value __referenced_in] @@ -356,7 +356,7 @@ [:bson query -cond $cond -orderby $orderby] \ -limit 1] 0] #puts "find first fetched: $tuple" - if {$instance ne ""} {set instance [:uplevel [list ::nsf::qualify $instance]]} + if {$instance ne ""} {set instance [:uplevel [list ::nsf::object::qualify $instance]]} return [:bson create -name $instance $tuple] } Index: library/nx/nx.tcl =================================================================== diff -u -rd40717ac3710f2123cb9359e3d0442ad4ff3da73 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- library/nx/nx.tcl (.../nx.tcl) (revision d40717ac3710f2123cb9359e3d0442ad4ff3da73) +++ library/nx/nx.tcl (.../nx.tcl) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -391,9 +391,9 @@ # internally by nsf. # proc ::nx::isSlotContainer {object} { - if {[::nsf::isobject $object] && [namespace tail $object] eq "slot"} { + if {[::nsf::object::exists $object] && [namespace tail $object] eq "slot"} { set parent [$object ::nsf::methods::object::info::parent] - return [expr {[::nsf::isobject $parent] + return [expr {[::nsf::object::exists $parent] && [::nsf::method::property $parent -per-object slot slotcontainer]}] } return 0 @@ -402,7 +402,7 @@ proc ::nx::slotObj {baseObject {name ""}} { # Create slot container object if needed set slotContainer ${baseObject}::slot - if {![::nsf::isobject $slotContainer]} { + if {![::nsf::object::exists $slotContainer]} { ::nx::Object ::nsf::methods::class::alloc $slotContainer ::nsf::method::property ${baseObject} -per-object slot call-protected true ::nsf::method::property ${baseObject} -per-object slot redefine-protected true @@ -494,12 +494,12 @@ :alias "info precedence" ::nsf::methods::object::info::precedence :method "info slot" {name} { set slot [::nsf::self]::slot::$name - if {[::nsf::isobject $slot]} {return $slot} + if {[::nsf::object::exists $slot]} {return $slot} return "" } :method "info slots" {{-type ::nx::Slot} {pattern ""}} { set slotContainer [::nsf::self]::slot - if {[::nsf::isobject $slotContainer]} { + if {[::nsf::object::exists $slotContainer]} { ::nsf::dispatch $slotContainer ::nsf::methods::object::info::children -type $type {*}$pattern } } @@ -1001,7 +1001,7 @@ # value contains no globbing meta characters, but elementtype is given if {[string first :: $value] == -1} { # get fully qualified name - if {![::nsf::isobject $value]} { + if {![::nsf::object::exists $value]} { error "$value does not appear to be an object" } set value [::nsf::dispatch $value -frame method ::nsf::self] @@ -1428,7 +1428,7 @@ :protected method init {} { :public method new {-childof args} { ::nsf::var::import [::nsf::current class] {container object} withclass - if {![::nsf::isobject $object]} { + if {![::nsf::object::exists $object]} { $withclass create $object } ::nsf::next [list -childof $object {*}$args] @@ -1451,7 +1451,7 @@ cmds } { if {![info exists object]} {set object [::nsf::self]} - if {![::nsf::isobject $object]} {$class create $object} + if {![::nsf::object::exists $object]} {$class create $object} # reused in XOTcl, no "require" there, so use nsf primitiva ::nsf::dispatch $object ::nsf::methods::object::requirenamespace if {$withnew} { @@ -1487,7 +1487,7 @@ lappend :targetList $t #puts stderr "COPY makeTargetList $t target= ${:targetList}" # if it is an object without namespace, it is a leaf - if {[::nsf::isobject $t]} { + if {[::nsf::object::exists $t]} { if {[::nsf::dispatch $t ::nsf::methods::object::info::hasnamespace]} { # make target list from all children set children [$t info children] @@ -1499,7 +1499,7 @@ # now append all namespaces that are in the obj, but that # are not objects foreach c [namespace children $t] { - if {![::nsf::isobject $c]} { + if {![::nsf::object::exists $c]} { lappend children [namespace children $t] } } @@ -1526,7 +1526,7 @@ #puts stderr "COPY will copy targetList = [set :targetList]" foreach origin [set :targetList] { set dest [:getDest $origin] - if {[::nsf::isobject $origin]} { + if {[::nsf::object::exists $origin]} { # copy class information if {[::nsf::is class $origin]} { set cl [[$origin info class] create $dest -noinit] @@ -1574,7 +1574,7 @@ if {$domain eq $origin} { set def [concat $dest [lrange $def 1 end]] } - if {[::nsf::isobject $domain] && [$domain info has type ::nx::Slot]} { + if {[::nsf::object::exists $domain] && [$domain info has type ::nx::Slot]} { # slot traces are handled already by the slot mechanism continue } Index: library/serialize/serializer.tcl =================================================================== diff -u -rb3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b -rda6586782390b02ed7660b56417c3db00d63d1c3 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision b3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -184,7 +184,7 @@ return 1 } # we do this for object trees without object-less namespaces - if {![::nsf::isobject $o]} { + if {![::nsf::object::exists $o]} { return 0 } set o [::nsf::dispatch $o ::nsf::methods::object::info::parent] @@ -276,7 +276,7 @@ catch {unset namespace(::ns)} foreach ns [array name namespace] { if {![namespace exists $ns]} continue - if {![::nsf::isobject $ns]} { + if {![::nsf::object::exists $ns]} { append pre_cmds "namespace eval $ns {}\n" } elseif {$ns ne [namespace origin $ns] } { append pre_cmds "namespace eval $ns {}\n" @@ -343,7 +343,7 @@ :class method checkExportedObject {} { foreach o [array names :exportObjects] { - if {![::nsf::isobject $o]} { + if {![::nsf::object::exists $o]} { :warn "Serializer exportObject: ignore non-existing object $o" unset :exportObjects($o) } else { @@ -552,14 +552,14 @@ # foreach k [Serializer exportedMethods] { foreach {o p m} $k break - if {![::nsf::isobject $o]} { + if {![::nsf::object::exists $o]} { :warn "$o is not an object" } elseif {[::nsf::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} { set :exportMethods($k) 1 } } foreach o [Serializer exportedObjects] { - if {![::nsf::isobject $o]} { + if {![::nsf::object::exists $o]} { :warn "$o is not an object" } elseif {[nsf::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} { set :exportObjects($o) 1 Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -rb3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b -rda6586782390b02ed7660b56417c3db00d63d1c3 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision b3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -705,8 +705,8 @@ # remove temporary method "alias" Object instproc alias {} {} - # emulation of isobject, isclass ... - Object instproc isobject {{object:substdefault "[self]"}} {::nsf::isobject $object} + # emulation of object::exists, isclass ... + Object instproc isobject {{object:substdefault "[self]"}} {::nsf::object::exists $object} Object instproc isclass {{class:substdefault "[self]"}} {::nsf::is class $class} Object instproc ismetaclass {{class:substdefault "[self]"}} {::nsf::is metaclass $class} Object instproc ismixin {class} { Index: tests/destroy.test =================================================================== diff -u -re3a84e351aaf79c02a63cc0741dde7b9bd550849 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- tests/destroy.test (.../destroy.test) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) +++ tests/destroy.test (.../destroy.test) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -29,18 +29,18 @@ C method foo {} { puts stderr "==== $::case [current]" :destroy - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::isobject c1} 1 "$::case object still exists in proc" + ? {::nsf::object::exists c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create c1 c1 foo -? {::nsf::isobject c1} 0 "$::case object deleted" +? {::nsf::object::exists c1} 0 "$::case object deleted" ? "set ::firstDestroy" 1 "firstDestroy called" @@ -54,18 +54,18 @@ C method foo {} { puts stderr "==== $::case [current]" :destroy - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::isobject c1} 1 "$::case object still exists in proc" + ? {::nsf::object::exists c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -? {::nsf::isobject c1} 1 "$::case object deleted" +? {::nsf::object::exists c1} 1 "$::case object deleted" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -79,18 +79,18 @@ C method foo {} { puts stderr "==== $::case [current]" [:info class] create [current] - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::isobject c1} 1 "$::case object still exists in proc" + ? {::nsf::object::exists c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -? {::nsf::isobject c1} 1 "$::case object deleted" +? {::nsf::object::exists c1} 1 "$::case object deleted" ? "set ::firstDestroy" 0 "firstDestroy called" # @@ -105,18 +105,18 @@ C method foo {} { puts stderr "==== $::case [current]" rename [current] "" - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::isobject c1} 1 "$::case object still exists in proc" + ? {::nsf::object::exists c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create c1 c1 foo -? {::nsf::isobject c1} 0 "$::case object still exists after proc" +? {::nsf::object::exists c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -132,19 +132,19 @@ C method foo {} { puts stderr "==== $::case [current]" rename [current] "" - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::isobject c1} 1 "$::case object still exists in proc" + ? {::nsf::object::exists 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 ======[c1 set x] -? {::nsf::isobject c1} 1 "$::case object still exists after proc" +? {::nsf::object::exists c1} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -160,18 +160,18 @@ C method foo {} { puts stderr "==== $::case [current]" rename o [current] - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 ? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::isobject c1} 1 "$::case object still exists in proc" + ? {::nsf::object::exists c1} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -? {::nsf::isobject c1} 1 "$::case object still exists after proc" +? {::nsf::object::exists c1} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -191,7 +191,7 @@ } C create c1 c1 foo -? {::nsf::isobject c1} 1 "$::case object still exists after proc" +? {::nsf::object::exists c1} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -212,28 +212,28 @@ puts stderr "==== $::case [current]" namespace delete ::test - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [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::isobject [current]]" - ? "::nsf::isobject [current]" 0 ;# WHY? - puts stderr "???? [current] exists [::nsf::isobject [current]]" + puts stderr "???? [current] exists [::nsf::object::exists [current]]" + ? "::nsf::object::exists [current]" 0 ;# WHY? + puts stderr "???? [current] exists [::nsf::object::exists [current]]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "$::case destroy not yet called" } } test::C create test::c1 test::c1 foo -? {::nsf::isobject test::c1} 0 "object still exists after proc" +? {::nsf::object::exists test::c1} 0 "object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "destroy was called when poping stack frame" -? {::nsf::isobject ::test::C} 0 "class still exists after proc" +? {::nsf::object::exists ::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" @@ -252,25 +252,25 @@ C method foo {} { puts stderr "==== $::case [current]" namespace delete ::test - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [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::isobject [current]]" - ? "::nsf::isobject [current]" 0 "$::case object still exists in proc";# WHY? - puts stderr "???? [current] exists [::nsf::isobject [current]]" + puts stderr "???? [current] exists [::nsf::object::exists [current]]" + ? "::nsf::object::exists [current]" 0 "$::case object still exists in proc";# WHY? + puts stderr "???? [current] exists [::nsf::object::exists [current]]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called"; # NOT YET CALLED } } test::C create test::c1 test::c1 foo -? {::nsf::isobject test::c1} 0 "$::case object still exists after proc" +? {::nsf::object::exists test::c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" ;# toplevel destroy was blocked @@ -288,21 +288,21 @@ puts stderr "==== $::case [current]" o destroy puts stderr "AAAA" - # the following isobject call has a problem in Tcl_GetCommandFromObj(), + # the following object::exists call has a problem in Tcl_GetCommandFromObj(), # which tries to access invalid memory - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBBB" - ? {::nsf::isobject ::o::c1} 0 "$::case object still exists in proc" + ? {::nsf::object::exists ::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 -? {::nsf::isobject ::o::c1} 0 "$::case object o::c1 still exists after proc" -? {::nsf::isobject o} 0 "$::case object o still exists after proc" +? {::nsf::object::exists ::o::c1} 0 "$::case object o::c1 still exists after proc" +? {::nsf::object::exists o} 0 "$::case object o still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -319,18 +319,18 @@ C method foo {} { puts stderr "==== $::case [current]" o destroy - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" - ? {::nsf::isobject ::o::c1} 0 "$::case object still exists in proc" + ? {::nsf::object::exists ::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 -? {::nsf::isobject ::o::c1} 0 "$::case object still exists after proc" +? {::nsf::object::exists ::o::c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -347,18 +347,18 @@ C method foo {} { puts stderr "==== $::case [current]" proc [current] {args} {puts HELLO} - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [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::isobject c1} 0 "$::case object still exists in proc" + ? {::nsf::object::exists c1} 0 "$::case object still exists in proc" } C create c1 c1 foo -? {::nsf::isobject c1} 0 "$::case object still exists after proc" +? {::nsf::object::exists c1} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -374,22 +374,22 @@ C method foo {} { puts stderr "==== $::case [current]" C destroy - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [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::isobject c1} 1 "object still exists in proc" + ? {::nsf::object::exists c1} 1 "object still exists in proc" #? {::nsf::is class ::C} 0 "class still exists in proc" ? {::nsf::is class ::C} 1 "class still exists in proc" } C create c1 c1 foo -? {::nsf::isobject c1} 1 "object still exists after proc" +? {::nsf::object::exists 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" @@ -404,7 +404,7 @@ C method foo {} { puts stderr "==== $::case [current]" C destroy - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 #? "[current] set x" 1 "$::case can still access [current]" puts stderr "BBB" @@ -414,13 +414,13 @@ ? "set ::ObjectDestroy" 1 "ObjectDestroy called" ? [:info class] ::C "object reclassed" #? [:info class] ::xotcl::Object "object reclassed" - ? {::nsf::isobject ::C::c1} 1 "object still exists in proc" + ? {::nsf::object::exists ::C::c1} 1 "object still exists in proc" ? {::nsf::is class ::C} 1 "class still exists in proc" } C create ::C::c1 C::c1 foo -#puts stderr ======[::nsf::isobject ::C::c1] -? {::nsf::isobject ::C::c1} 0 "object still exists after proc" +#puts stderr ======[::nsf::object::exists ::C::c1] +? {::nsf::object::exists ::C::c1} 0 "object still exists after proc" ? {::nsf::is class ::C} 0 "class still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -430,8 +430,8 @@ Object create x Object create x::y x destroy - ? {::nsf::isobject x} 0 "parent object gone" - ? {::nsf::isobject x::y} 0 "child object gone" + ? {::nsf::object::exists x} 0 "parent object gone" + ? {::nsf::object::exists x::y} 0 "child object gone" } Test case deleting-aliased-object { @@ -459,18 +459,18 @@ Object create o3 ::nsf::method::alias o x o3 o destroy -? {::nsf::isobject o} 0 "parent object gone" -? {::nsf::isobject o3} 1 "aliased object still here" +? {::nsf::object::exists o} 0 "parent object gone" +? {::nsf::object::exists o3} 1 "aliased object still here" o3 destroy -? {::nsf::isobject o3} 0 "aliased object destroyed" +? {::nsf::object::exists 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::method::alias o x o3 o::x destroy -? {::nsf::isobject o3} 0 "aliased object destroyed" +? {::nsf::object::exists o3} 0 "aliased object destroyed" o destroy # @@ -521,8 +521,8 @@ C alias b o C create c1 C destroy - ? {::nsf::isobject o} 1 "object o still here" - ? {::nsf::isobject o3} 1 "object o3 still here" + ? {::nsf::object::exists o} 1 "object o still here" + ? {::nsf::object::exists o3} 1 "object o3 still here" } # @@ -557,23 +557,23 @@ } ? {::nsf::is class ::module::Foo} 1 ? {::nsf::is class ::module::foo} 0 - ? {::nsf::isobject ::module::foo} 1 + ? {::nsf::object::exists ::module::foo} 1 ? {::nsf::is class ::module} 1 Object create ::o { :require namespace } namespace eval ::o {namespace import ::module::*} ? {::nsf::is class ::o::Foo} 1 - ? {::nsf::isobject ::o::foo} 1 + ? {::nsf::object::exists ::o::foo} 1 # do not destroy namespace imported objects/classes ::o destroy ? {::nsf::is class ::o::Foo} 0 - ? {::nsf::isobject ::o::foo} 0 + ? {::nsf::object::exists ::o::foo} 0 ? {::nsf::is class ::module::Foo} 1 - ? {::nsf::isobject ::module::foo} 1 + ? {::nsf::object::exists ::module::foo} 1 ::module destroy } @@ -587,27 +587,27 @@ C method foo {} { puts stderr "==== $::case [current]" namespace delete ::test - puts stderr "AAAA [current] exists [::nsf::isobject [current]]" + puts stderr "AAAA [current] exists [::nsf::object::exists [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::isobject [current]]" - ? "::nsf::isobject [current]" 0 ;# WHY? - puts stderr "???? [current] exists [::nsf::isobject [current]]" + puts stderr "???? [current] exists [::nsf::object::exists [current]]" + ? "::nsf::object::exists [current]" 0 ;# WHY? + puts stderr "???? [current] exists [::nsf::object::exists [current]]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "$::case destroy not yet called" } } test::C create test::c1 test::c1 foo -? {::nsf::isobject test::c1} 0 "object still exists after proc" +? {::nsf::object::exists test::c1} 0 "object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "destroy was called when poping stack frame" -? {::nsf::isobject ::test::C} 0 "class still exists after proc" +? {::nsf::object::exists ::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" @@ -693,7 +693,7 @@ :public method destroy {} { #puts stderr "[self] destroy ${:os}" foreach o ${:os} { - if {[::nsf::isobject $o]} { + if {[::nsf::object::exists $o]} { #puts stderr "--D $o destroy" $o destroy } Index: tests/doc.test =================================================================== diff -u -rb3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b -rda6586782390b02ed7660b56417c3db00d63d1c3 --- tests/doc.test (.../doc.test) (revision b3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b) +++ tests/doc.test (.../doc.test) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -175,7 +175,7 @@ # TODO: Do not enforce space line between the context and immediate # part block (when description is skipped)? # - # OR: For absolutely qualifying parts (e.g., outside of an initcmd block), + # OR: For absolutely object::qualifying parts (e.g., outside of an initcmd block), # do we need sequences of _two_ (or more) tag lines, e.g. # # -- @@ -186,7 +186,7 @@ # THEN, we can only discriminate between the context and an # immediate part section by requiring a space line! # - # Alternatively, we can use the @see like syntax for qualifying: + # Alternatively, we can use the @see like syntax for object::qualifying: # @param ::Foo#attr1 (I have a preference for this option). set block { {@command ::cc} @@ -547,7 +547,7 @@ set cbp [CommentBlockParser process -parsing_level 2 -partof_entity $entity $block] ? [list $cbp status ? COMPLETED] 1 set entity [$cbp current_entity] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@object] 1 ? [list $entity as_text] "We have a tag notation sensitive to the parsing level" @@ -758,52 +758,52 @@ # --testing-- "@class ::C" set entity [@class id ::C] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@class] 1 ? [list $entity as_text] "The global description of ::C"; # --testing-- "@class.attribute {::C attr1}" set entity [@attribute id $entity class attr1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@attribute] 1 ? [list $entity as_text] "Here, we could also write '@class.class-attribute {::C attr1}', @attribute is a mere forwarder! In the context section, only one-liners are allowed!" # --testing-- "@class.object.attribute {::C foo p1} A short description is ..." # set entity [@attribute id $entity class attr1] # set entity [@object id -partof_name ::C -scope child foo] - # ? [list ::nsf::isobject $entity] 1 + # ? [list ::nsf::object::exists $entity] 1 # ? [list $entity info has type ::nx::doc::@object] 1 # ? [list $entity as_text] "" # set entity [@attribute id $entity object p1] - # ? [list ::nsf::isobject $entity] 1 + # ? [list ::nsf::object::exists $entity] 1 # ? [list $entity info has type ::nx::doc::@attribute] 1 # ? [list $entity as_text] ".. is overruled by a long one ..." set entity [@object id ::C::foo] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 set entity [@attribute id $entity class p1] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 # ? [list $entity info has type ::nx::doc::@attribute] 1 # ? [list $entity as_text] ".. is overruled by a long one ..." # --testing-- @class-object-attribute attr2 (its non-existance) set entity [@attribute id [@class id ::C] class attr2] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 # --testing-- @child-class Foo (its non-existance) set entity [@class id ::C::Foo] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 # --testing -- @method foo (its non-existance) set entity [@method id ::C class foo] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 # --testing-- @class-object-method.parameter {bar p1} (its non-existance) set entity [@parameter id [@method id ::C class bar] "" p1] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 # --testing-- @child-object.attribute {foo p1} (its non-existance) set cl [@class id ::C::Foo] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 set entity [@attribute id $cl class p1] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 set entity [@attribute id $cl class p2] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 # # 2) process the initcmd comments (PARSING LEVEL 1) @@ -823,84 +823,84 @@ set entity [@class id ::C] ? $_ $entity - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@class] 1 ? [list $entity as_text] "This is the initcmd-level description of ::C which overwrites the global description (see above)" set entity [@attribute id $entity class attr1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@attribute] 1 ? [list $entity as_text] {This is equivalent to writing "@class-attribute attr1"} set entity [@object id ::C::foo] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@object] 1 ? [list $entity as_text] "'foo' needs to be defined before referencing any of its parts!"; # still empty! set entity [@attribute id $entity class p1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@attribute] 1 ? [list $entity as_text] "The first element in the name list is resolved into a fully qualified (absolute) entity, based on the object owning the initcmd!" # b) newly added ... # --testing-- @class-object-attribute attr2 set entity [@attribute id [@class id ::C] class attr2] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@attribute] 1 ? [list $entity as_text] "Carries a short desc only"; # --testing-- @child-class Foo # TODO: provide a check against fully-qualified names in part specifications set entity [@class id ::C::Foo] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@class] 1 ? [list $entity as_text] {By providing a fully-qualified identifier ("::Foo") you leave the context of the initcmd-owning object, i.e. you would NOT refer to a nested class object named "Foo" anymore!} set entity [@attribute id [@class id ::C] class p1] - ? [list ::nsf::isobject $entity] 0; # should be 0 at this stage! + ? [list ::nsf::object::exists $entity] 0; # should be 0 at this stage! # --testing -- @method foo set entity [@method id ::C class foo] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "" # --testing-- @class-object-method.parameter {bar p1} (its non-existance) It # still cannot exist as a documented entity, as the class method # has not been initialised before! set entity [@parameter id [@method id ::C class bar] "" p1] - ? [list ::nsf::isobject $entity] 0 + ? [list ::nsf::object::exists $entity] 0 # --testing-- @child-class.attribute {foo p1} (its non-existance) # --testing-- @child-class.object-attribute {foo p2} (its non-existance) set cl [@class id ::C::Foo] - ? [list ::nsf::isobject $cl] 1 + ? [list ::nsf::object::exists $cl] 1 set entity [@attribute id $cl class p1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] {This is equivalent to stating "@child-class.class-attribute {Foo p1}"} set entity [@attribute id $cl class p2] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "Y" set entity [@method id ::C class sub] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "The desc of the ensemble object 'sub'" set entity [@method id ::C class sub::bar] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "Only description available here ..." set entity [@method id ::C object sub] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "A brief desc" set entity [@method id ::C object sub::foo2] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@method] 1 ? [list $entity as_text] "could allow both (@sub-method is the attribute name, @method is a forwarder in the context of an owning @method object!)" ? [list $entity @see] "anotherentity" # TODO: @author not supported for @method (fine so?) # ? [list $entity @author] "ss@thinkersfoot" set entity [@parameter id $entity "" p1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "Some words on p1" # @@ -914,17 +914,17 @@ # methods ... set entity [@method id ::C class foo] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "Here goes some method-body-level description" set entity [@parameter id [@method id ::C class foo] "" p1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "The most specific level!" # attributes ... # attr1 set entity [@attribute id [@class id ::C] class attr1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@attribute] 1 ? [list $entity as_text] {This description does not apply to the object parameter "attr1" owned by the ::C class, rather it is a description of the attribute slot object! How should we deal with this situation? Should this level overwrite the top-level and initcmd-level descriptions?} @@ -941,11 +941,11 @@ processor process=@object $project [@object id ::C::foo] set entity [@object id ::C::foo] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@object] 1 ? [list $entity as_text] "Adding a line for the first time (not processed in the initcmd phase!)"; # still empty! set entity [@attribute id $entity class p1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity info has type ::nx::doc::@attribute] 1 ? [list $entity as_text] {This is equivalent to stating "@class-object-attribute p1"} @@ -958,12 +958,12 @@ processor process=@class $project [@class id ::C::Foo] set cl [@class id ::C::Foo] - ? [list ::nsf::isobject $cl] 1 + ? [list ::nsf::object::exists $cl] 1 set entity [@attribute id $cl class p1] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] {This is equivalent to stating "@class-attribute p1"; or '@class.object.attribute {::C Foo p1}' from the top-level.} set entity [@attribute id $cl class p2] - ? [list ::nsf::isobject $entity] 1 + ? [list ::nsf::object::exists $entity] 1 ? [list $entity as_text] "" # @@ -1095,11 +1095,11 @@ ::nsf::exithandler ::nsf::forward ::nsf::var::import - ::nsf::isobject + ::nsf::object::exists ::nsf::method ::nsf::method::property ::nsf::method::provide - ::nsf::qualify + ::nsf::object::qualify ::nsf::method::require ::nsf::setter ::nsf::var::set Index: tests/methods.test =================================================================== diff -u -r211c77c1a94a47be185a8bfb12c89512937b1901 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- tests/methods.test (.../methods.test) (revision 211c77c1a94a47be185a8bfb12c89512937b1901) +++ tests/methods.test (.../methods.test) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -347,8 +347,8 @@ c1 destroy C destroy - ? {nsf::isobject c1} 0 - ? {nsf::isobject C} 0 + ? {nsf::object::exists c1} 0 + ? {nsf::object::exists C} 0 # create it from the serialized code eval $s(C) Index: tests/object-system.test =================================================================== diff -u -r0e33ba821d29af5a646fd29c2722baedddcc25b8 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- tests/object-system.test (.../object-system.test) (revision 0e33ba821d29af5a646fd29c2722baedddcc25b8) +++ tests/object-system.test (.../object-system.test) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -21,21 +21,21 @@ ? {::nsf::configure objectsystem} "{::nx::Object ::nx::Class {-class.alloc alloc -class.create create -class.dealloc dealloc -class.recreate recreate -class.requireobject __unknown -object.configure configure -object.defaultmethod defaultmethod -object.destroy destroy -object.init init -object.move move -object.objectparameter objectparameter -object.unknown unknown}}" -? {::nsf::isobject Object} 1 +? {::nsf::object::exists Object} 1 ? {::nsf::is class Object} 1 ? {::nsf::is metaclass Object} 0 ? {Object info superclass} "" ? {Object info class} ::nx::Class -? {::nsf::isobject Class} 1 +? {::nsf::object::exists Class} 1 ? {::nsf::is class Class} 1 ? {::nsf::is metaclass Class} 1 ? {Class info superclass} ::nx::Object ? {Class info class} ::nx::Class Object create o -? {::nsf::isobject Object} 1 +? {::nsf::object::exists Object} 1 ? {::nsf::is class o} 0 ? {::nsf::is metaclass o} 0 ? {o info class} ::nx::Object @@ -50,27 +50,27 @@ #? {lsort [Class info vars]} "__default_metaclass __default_superclass" Class create M -superclass ::nx::Class -? {::nsf::isobject M} 1 +? {::nsf::object::exists M} 1 ? {::nsf::is class M} 1 ? {::nsf::is metaclass M} 1 ? {M info superclass} ::nx::Class ? {M info class} ::nx::Class M create C -? {::nsf::isobject C} 1 +? {::nsf::object::exists C} 1 ? {::nsf::is class C} 1 ? {::nsf::is metaclass C} 0 ? {C info superclass} ::nx::Object ? {C info class} ::M C create c1 -? {::nsf::isobject c1} 1 +? {::nsf::object::exists c1} 1 ? {::nsf::is class c1} 0 ? {::nsf::is metaclass c1} 0 ? {c1 info class} ::C Class create M2 -superclass M -? {::nsf::isobject M2} 1 +? {::nsf::object::exists M2} 1 ? {::nsf::is class M2} 1 ? {::nsf::is metaclass M2} 1 ? {M2 info superclass} ::M @@ -83,7 +83,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::isobject C} 1 +? {::nsf::object::exists C} 1 ? {::nsf::is class C} 1 ? {::nsf::is metaclass C} 0 ? {C info superclass} ::nx::Object @@ -97,7 +97,7 @@ # destroy class M, reclass class instances to the base class C destroy -? {::nsf::isobject c1} 1 +? {::nsf::object::exists c1} 1 ? {::nsf::is object c1} 1 ? {::nsf::is class c1} 0 ? {::nsf::is metaclass c1} 0 @@ -106,15 +106,15 @@ # basic attributes tests Class create C -attributes {{x 1} {y 2}} -? {::nsf::isobject C} 1 -? {::nsf::isobject C::slot} 1 +? {::nsf::object::exists C} 1 +? {::nsf::object::exists C::slot} 1 ? {C info children} ::C::slot C copy X -? {::nsf::isobject X} 1 +? {::nsf::object::exists X} 1 ? {X info vars} "" ? {C info vars} "" -? {::nsf::isobject X::slot} 1 +? {::nsf::object::exists X::slot} 1 #? {C::slot info vars} __parameter ? {C info attributes} {{x 1} {y 2}} @@ -170,13 +170,13 @@ # create a minimal object system without internally dipatched methods ::nsf::createobjectsystem ::object ::class -? {::nsf::isobject ::object} 1 +? {::nsf::object::exists ::object} 1 ? {::nsf::is class ::object} 1 ? {::nsf::is metaclass ::object} 0 ? {::nsf::relation ::object class} ::class ? {::nsf::relation ::object superclass} "" -? {::nsf::isobject ::class} 1 +? {::nsf::object::exists ::class} 1 ? {::nsf::is class ::class} 1 ? {::nsf::is metaclass ::class} 1 ? {::nsf::relation ::class class} ::class @@ -189,7 +189,7 @@ # create a class named C ::class + C -? {::nsf::isobject ::C} 1 +? {::nsf::object::exists ::C} 1 ? {::nsf::is class ::C} 1 ? {::nsf::is metaclass ::C} 0 ? {::nsf::relation ::C class} ::class @@ -198,15 +198,15 @@ # create an instance of C C + c1 -? {::nsf::isobject ::c1} 1 +? {::nsf::object::exists ::c1} 1 ? {::nsf::is class ::c1} 0 ? {::nsf::is metaclass ::c1} 0 ? {::nsf::relation ::c1 class} ::C # destroy instance c1 - -? {::nsf::isobject ::c1} 0 +? {::nsf::object::exists ::c1} 0 ? {::nsf::is class ::C} 1 # recreate an nx object with a namespace @@ -215,7 +215,7 @@ # destroy class C - -? {::nsf::isobject ::C} 0 +? {::nsf::object::exists ::C} 0 ::nx::Class create ::C Index: tests/parameters.test =================================================================== diff -u -r5b2eafb18ce22d7aa8cef352f535da5046cac7d9 -rda6586782390b02ed7660b56417c3db00d63d1c3 --- tests/parameters.test (.../parameters.test) (revision 5b2eafb18ce22d7aa8cef352f535da5046cac7d9) +++ tests/parameters.test (.../parameters.test) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -8,9 +8,9 @@ ? {::namespace current} :: set o [Object create o] - ? {::nsf::isobject ::o} 1 + ? {::nsf::object::exists ::o} 1 } -? {::nsf::isobject ::o} 0 +? {::nsf::object::exists ::o} 0 ####################################################### # parametercheck @@ -24,8 +24,8 @@ Class create M c1 mixin M - ? {::nsf::isobject o1} 1 - ? {::nsf::isobject o1000} 0 + ? {::nsf::object::exists o1} 1 + ? {::nsf::object::exists o1000} 0 ? {::nsf::is class C} 1 ? {C info is class} 1 Index: tests/varresolution.test =================================================================== diff -u -rb3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b -rda6586782390b02ed7660b56417c3db00d63d1c3 --- tests/varresolution.test (.../varresolution.test) (revision b3018d3be0f1524a3f1709edc0e2ddb5d8bc4c0b) +++ tests/varresolution.test (.../varresolution.test) (revision da6586782390b02ed7660b56417c3db00d63d1c3) @@ -409,7 +409,7 @@ ::C create ::c namespace eval ::c {} ? {namespace exists ::c} 1 -? {::nsf::isobject ::c} 1 +? {::nsf::object::exists ::c} 1 ? {::c info has namespace} 0 ? {::c Set w 2; expr {[::c Set w] == $::w}} 0