Index: generic/predefined.h =================================================================== diff -u -r16696cd93d38760506be3dfc95fb2bb7ae972d2f -rf9e18344d59553044453d08e464acce46664ffcf --- generic/predefined.h (.../predefined.h) (revision 16696cd93d38760506be3dfc95fb2bb7ae972d2f) +++ generic/predefined.h (.../predefined.h) (revision f9e18344d59553044453d08e464acce46664ffcf) @@ -59,7 +59,7 @@ "::xotcl::classInfo proc unknown {method args} {\n" "error \"unknown info option \\\"$method\\\"; [my info info]\"}\n" "# info instargs\n" -"# istype??\n" +"# istype\n" "proc ::xotcl::info_args {inst o method} {\n" "set result [list]\n" "foreach \\\n" @@ -95,6 +95,11 @@ "::xotcl::classInfo proc instdefault {o method arg var} {::xotcl::info_default inst $o $method $arg $var}\n" "::xotcl::classInfo proc default {o method arg var} {::xotcl::info_default \"\" $o $method $arg $var}\n" "::xotcl::objectInfo proc default {o method arg var} {::xotcl::info_default \"\" $o $method $arg $var}\n" +"::xotcl::Object instproc isobject {{object:substdefault \"[self]\"}} {::xotcl::is $object object}\n" +"::xotcl::Object instproc isclass {{class:substdefault \"[self]\"}} {::xotcl::is $class class}\n" +"::xotcl::Object instproc ismetaclass {{class:substdefault \"[self]\"}} {::xotcl::is $class metaclass}\n" +"::xotcl::Object instproc ismixin {class} {::xotcl::is [self] mixin $class}\n" +"::xotcl::Object instproc istype {class} {::xotcl::is [self] type $class}\n" "::xotcl::Object create ::xotcl::@\n" "::xotcl::@ proc unknown args {}\n" "proc ::xotcl::myproc {args} {linsert $args 0 [::xotcl::self]}\n" @@ -213,10 +218,10 @@ "set value ::$value}\n" "return [$obj $prop [lsearch -all -not -glob -inline $old $value]]} elseif {[my elementtype] ne \"\"} {\n" "if {[string first :: $value] == -1} {\n" -"if {![my isobject $value]} {\n" +"if {![::xotcl::is $value object]} {\n" "error \"$value does not appear to be an object\"}\n" "set value [$value self]}\n" -"if {![$value isclass [my elementtype]]} {\n" +"if {![::xotcl::is [my elementtype] class]} {\n" "error \"$value does not appear to be of type [my elementtype]\"}}\n" "set p [lsearch -exact $old $value]\n" "if {$p > -1} {\n" @@ -276,9 +281,9 @@ "set __initcmd \"\"\n" "if {[::xotcl::my exists type]} {\n" "::xotcl::my instvar type name\n" -"if {[::xotcl::Object isclass $type]} {\n" +"if {[::xotcl::is $type class]} {\n" "set predicate [subst -nocommands {\n" -"[::xotcl::Object isobject \\$value] && [\\$value istype $type]}]} elseif {[llength $type]>1} {\n" +"[::xotcl::is \\$value object] && [::xotcl::is \\$value type $type]}]} elseif {[llength $type]>1} {\n" "set predicate \"\\[$type \\$value\\]\"} else {\n" "set predicate \"\\[[self] type=$type $name \\$value\\]\"}\n" "::xotcl::my append valuechangedcmd [subst {\n" @@ -324,7 +329,7 @@ "::xotcl::ScopedNew instproc init {} {\n" "::xotcl::my instproc new {-childof args} {\n" "[::xotcl::self class] instvar {inobject object} withclass\n" -"if {![::xotcl::my isobject $object]} {\n" +"if {![::xotcl::is $object object]} {\n" "$withclass create $object}\n" "eval ::xotcl::next -childof $object $args}}\n" "::xotcl::Object instproc contains {\n" @@ -333,7 +338,7 @@ "{-class ::xotcl::Object}\n" "cmds} {\n" "if {![info exists object]} {set object [::xotcl::self]}\n" -"if {![::xotcl::my isobject $object]} {$class create $object}\n" +"if {![::xotcl::is $object object]} {$class create $object}\n" "$object requireNamespace\n" "if {$withnew} {\n" "set m [::xotcl::ScopedNew new \\\n" @@ -399,8 +404,8 @@ "::xotcl::Object instproc defaultmethod {} {\n" "return [::xotcl::self]}\n" "::xotcl::Object instproc hasclass cl {\n" -"if {[::xotcl::my ismixin $cl]} {return 1}\n" -"::xotcl::my istype $cl}\n" +"if {[::xotcl::is [self] mixin $cl]} {return 1}\n" +"::xotcl::is [self] type $cl}\n" "::xotcl::Class instproc allinstances {} {\n" "return [::xotcl::my info instances -closure]}\n" "::xotcl::Object proc unsetExitHandler {} {\n" @@ -427,12 +432,12 @@ "objLength}\n" "::xotcl::Object::CopyHandler instproc makeTargetList t {\n" "::xotcl::my lappend targetList $t\n" -"if {[::xotcl::my isobject $t]} {\n" +"if {[::xotcl::is $t object]} {\n" "if {[$t info hasnamespace]} {\n" "set children [$t info children]} else {\n" "return}}\n" "foreach c [namespace children $t] {\n" -"if {![::xotcl::my isobject $c]} {\n" +"if {![::xotcl::is $c object]} {\n" "lappend children [namespace children $t]}}\n" "foreach c $children {\n" "::xotcl::my makeTargetList $c}}\n" @@ -445,8 +450,8 @@ "::xotcl::Object::CopyHandler instproc copyTargets {} {\n" "foreach origin [::xotcl::my set targetList] {\n" "set dest [::xotcl::my getDest $origin]\n" -"if {[::xotcl::my isobject $origin]} {\n" -"if {[::xotcl::my isclass $origin]} {\n" +"if {[::xotcl::is $origin object]} {\n" +"if {[::xotcl::is $origin class]} {\n" "set cl [[$origin info class] create $dest -noinit]\n" "set obj $cl\n" "$cl superclass [$origin info superclass]\n" @@ -465,7 +470,7 @@ "::xotcl::my copyNSVarsAndCmds $origin $dest\n" "foreach i [$origin info forward] {\n" "eval [concat $dest forward $i [$origin info forward -definition $i]]}\n" -"if {[::xotcl::my isclass $origin]} {\n" +"if {[::xotcl::is $origin class]} {\n" "foreach i [$origin info instforward] {\n" "eval [concat $dest instforward $i [$origin info instforward -definition $i]]}}\n" "set traces [list]\n" @@ -478,7 +483,7 @@ "set def [concat $dest [lrange $def 1 end]]}\n" "$dest trace add variable $var $op $def}}}}\n" "foreach origin [::xotcl::my set targetList] {\n" -"if {[::xotcl::my isclass $origin]} {\n" +"if {[::xotcl::is $origin class]} {\n" "set dest [::xotcl::my getDest $origin]\n" "foreach oldslot [$origin info slots] {\n" "set newslot ${dest}::slot::[namespace tail $oldslot]\n" @@ -496,7 +501,7 @@ "if {[string trimleft $newName :] ne [string trimleft [::xotcl::self] :]} {\n" "if {$newName ne \"\"} {\n" "::xotcl::my copy $newName}\n" -"if {[::xotcl::my isclass [::xotcl::self]] && $newName ne \"\"} {\n" +"if {[::xotcl::is [::xotcl::self] class] && $newName ne \"\"} {\n" "foreach subclass [::xotcl::my info subclass] {\n" "set scl [$subclass info superclass]\n" "if {[set index [lsearch -exact $scl [::xotcl::self]]] != -1} {\n"