Index: generic/predefined.h =================================================================== diff -u -rf37d836d9b24c8cdf9a44b29da6a2bd92dfd3716 -r90f13fe04f5c707be3b56808a8a7992adab1855f --- generic/predefined.h (.../predefined.h) (revision f37d836d9b24c8cdf9a44b29da6a2bd92dfd3716) +++ generic/predefined.h (.../predefined.h) (revision 90f13fe04f5c707be3b56808a8a7992adab1855f) @@ -88,7 +88,9 @@ "set domain [self callingobject]}\n" "$domain $forwarder $name -default [$manager defaultmethods] $manager %1 %self %proc}\n" "::xotcl::MetaSlot create ::xotcl::InfoSlot -array set __defaults {\n" -"multivalued true}\n" +"multivalued true\n" +"elementtype ::xotcl::Class}\n" +"::xotcl::InfoSlot instparametercmd elementtype\n" "::xotcl::setrelation ::xotcl::InfoSlot superclass ::xotcl::Slot\n" "::xotcl::InfoSlot instproc get {obj prop} {$obj info $prop}\n" "::xotcl::InfoSlot instproc add {obj prop value {pos 0}} {\n" @@ -97,8 +99,19 @@ "$obj $prop [linsert [$obj info $prop] $pos $value]}\n" "::xotcl::InfoSlot instproc delete {-nocomplain:switch obj prop value} {\n" "set old [$obj info $prop]\n" -"set p [lsearch -glob $old $value]\n" -"if {$p>-1} {$obj $prop [lreplace $old $p $p]} else {\n" +"if {[string first * $value] > -1 || [string first \\[ $value] > -1} {\n" +"if {[my elementtype] ne \"\" && ![string match ::* $value]} {\n" +"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" +"error \"$value does not appear to be an object\"}\n" +"set value [$value self]}\n" +"if {![$value isclass [my elementtype]]} {\n" +"error \"$value does not appear to be of type [my elementtype]\"}}\n" +"set p [lsearch -exact $old $value]\n" +"if {$p > -1} {\n" +"$obj $prop [lreplace $old $p $p]} else {\n" "error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" "::xotcl::MetaSlot create ::xotcl::InterceptorSlot\n" "::xotcl::setrelation ::xotcl::InterceptorSlot superclass ::xotcl::InfoSlot\n" @@ -115,9 +128,9 @@ "::xotcl::InfoSlot create ::xotcl::Object::slot::class\n" "::xotcl::alias ::xotcl::Object::slot::class assign ::xotcl::setrelation\n" "::xotcl::InterceptorSlot create ::xotcl::Object::slot::mixin\n" -"::xotcl::InterceptorSlot create ::xotcl::Object::slot::filter\n" +"::xotcl::InterceptorSlot create ::xotcl::Object::slot::filter -elementtype \"\"\n" "::xotcl::InterceptorSlot create ::xotcl::Class::slot::instmixin\n" -"::xotcl::InterceptorSlot create ::xotcl::Class::slot::instfilter\n" +"::xotcl::InterceptorSlot create ::xotcl::Class::slot::instfilter -elementtype \"\"\n" "::xotcl::MetaSlot create ::xotcl::Attribute -superclass ::xotcl::Slot\n" "foreach p {default value_check initcmd valuecmd valuechangedcmd} {\n" "::xotcl::Attribute instparametercmd $p}\n"