Index: generic/predefined.h =================================================================== diff -u -rd56d2a8ee3f246c9891783abb09bd820dbc508e4 -r2454ab78913d0686b2ec5feeb401a051dc6a6164 --- generic/predefined.h (.../predefined.h) (revision d56d2a8ee3f246c9891783abb09bd820dbc508e4) +++ generic/predefined.h (.../predefined.h) (revision 2454ab78913d0686b2ec5feeb401a051dc6a6164) @@ -41,7 +41,9 @@ "if {$what in [list \"alias\" \"forward\" \"method\" \"setter\"]} {\n" "return [::xotcl::dispatch [self] ::xotcl::classes::xotcl2::Object::$what {*}$args]}\n" "if {$what in [list \"info\"]} {\n" -"::xotcl2::objectInfo [lindex $args 0] [self] {*}[lrange $args 1 end]}}\n" +"return [::xotcl2::objectInfo [lindex $args 0] [self] {*}[lrange $args 1 end]]}\n" +"if {$what in [list \"filter\" \"mixin\"]} {\n" +"return [.object-$what {*}$args]}}\n" ".method unknown {m args} {\n" "error \"Method '$m' unknown for [self].\\\n" "Consider '[self] create $m $args' instead of '[self] $m $args'\"}}\n" @@ -81,7 +83,7 @@ "::xotcl::setter [self] $methodName -per-object}}\n" "Class public method setter {methodName value:optional} {\n" "if {[info exists value]} {\n" -"::xotcl::setter [self] $methodName $value} else {\n" +"::xotcl::setter [self] $methodName $value} else {\n" "::xotcl::setter [self] $methodName}}\n" "Object create ::xotcl2::objectInfo\n" "Object create ::xotcl2::classInfo\n" @@ -200,6 +202,7 @@ "$class __invalidateobjectparameter}\n" "createBootstrapAttributeSlots ::xotcl::Slot {\n" "{name \"[namespace tail [::xotcl::self]]\"}\n" +"{methodname \"[namespace tail [::xotcl::self]]\"}\n" "{domain \"[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::xotcl::self]] 1]\"}\n" "{defaultmethods {get assign}}\n" "{manager \"[::xotcl::self]\"}\n" @@ -241,8 +244,7 @@ "set cl [expr {${.per-object} ? \"Object\" : \"Class\"}]\n" "::xotcl::dispatch ${.domain} ::xotcl::classes::xotcl2::${cl}::forward \\\n" "${.name} ${.manager} [list %1 [${.manager} defaultmethods]] %self \\\n" -"\"%-per-object [info exists .forward-per-object]\" \\\n" -"%proc}}\n" +"${.methodname}}}\n" "::xotcl::MetaSlot create ::xotcl::InfoSlot\n" "createBootstrapAttributeSlots ::xotcl::InfoSlot {\n" "{multivalued true}\n" @@ -253,15 +255,12 @@ "::xotcl::InfoSlot public method add {obj prop value {pos 0}} {\n" "if {![set .multivalued]} {\n" "error \"Property $prop of ${.domain}->$obj ist not multivalued\"}\n" -"puts stderr \"adding infoslot: $obj $prop [linsert [$obj info $prop] $pos $value]\"\n" "$obj $prop [linsert [$obj info $prop] $pos $value]}\n" -"::xotcl::InfoSlot public method delete {-nocomplain:switch obj prop value} {\n" -"puts stderr infoslot-delete-[self args]\n" -"set old [$obj info $prop]\n" +"::xotcl::InfoSlot protected method delete_value {obj prop old value} {\n" "if {[string first * $value] > -1 || [string first \\[ $value] > -1} {\n" "if {${.elementtype} ne \"\" && ![string match ::* $value]} {\n" "set value ::$value}\n" -"return [$obj $prop [lsearch -all -not -glob -inline $old $value]]} elseif {${.elementtype} ne \"\"} {\n" +"return [lsearch -all -not -glob -inline $old $value]} elseif {${.elementtype} ne \"\"} {\n" "if {[string first :: $value] == -1} {\n" "if {![::xotcl::is $value object]} {\n" "error \"$value does not appear to be an object\"}\n" @@ -270,20 +269,23 @@ "error \"$value does not appear to be of type ${.elementtype}\"}}\n" "set p [lsearch -exact $old $value]\n" "if {$p > -1} {\n" -"$obj $prop [lreplace $old $p $p]} else {\n" +"return [lreplace $old $p $p]} else {\n" "error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" +"::xotcl::InfoSlot public method delete {-nocomplain:switch obj prop value} {\n" +"$obj $prop [.delete_value $obj $prop [$obj info $prop] $value]}\n" "::xotcl::MetaSlot alloc ::xotcl::InterceptorSlot\n" "::xotcl::relation ::xotcl::InterceptorSlot superclass ::xotcl::InfoSlot\n" "::xotcl::alias ::xotcl::InterceptorSlot set ::xotcl::relation ;# for backwards compatibility\n" "::xotcl::alias ::xotcl::InterceptorSlot assign ::xotcl::relation\n" -"::xotcl::InterceptorSlot public method get {obj -per-object:switch prop} {\n" -"::xotcl::relation $obj {*}[expr {${per-object} ? \"-per-object\" : \"\"}] $prop}\n" -"::xotcl::InterceptorSlot public method add {obj -per-object:switch prop value {pos 0}} {\n" +"::xotcl::InterceptorSlot public method get {obj prop} {\n" +"::xotcl::relation $obj $prop}\n" +"::xotcl::InterceptorSlot public method add {obj prop value {pos 0}} {\n" "if {![set .multivalued]} {\n" "error \"Property $prop of ${.domain}->$obj ist not multivalued\"}\n" -"set perObject [expr {${per-object} ? \"-per-object\" : \"\"}]\n" -"set oldSetting [::xotcl::relation $obj {*}$perObject $prop]\n" -"::xotcl::relation $obj {*}$perObject $prop [linsert $oldSetting $pos $value]}\n" +"set oldSetting [::xotcl::relation $obj $prop]\n" +"::xotcl::relation $obj $prop [linsert $oldSetting $pos $value]}\n" +"::xotcl::InterceptorSlot public method delete {-nocomplain:switch obj prop value} {\n" +"::xotcl::relation $obj $prop [.delete_value $obj $prop [::xotcl::relation $obj $prop] $value]}\n" "proc ::xotcl::register_system_slots {os} {\n" "${os}::Object alloc ${os}::Class::slot\n" "${os}::Object alloc ${os}::Object::slot\n" @@ -292,8 +294,16 @@ "::xotcl::InfoSlot create ${os}::Object::slot::class -type relation\n" "::xotcl::alias ${os}::Object::slot::class assign ::xotcl::relation\n" "::xotcl::InterceptorSlot create ${os}::Object::slot::mixin \\\n" -"-type relation\n" +"-type relation -methodname object-mixin\n" "::xotcl::InterceptorSlot create ${os}::Object::slot::filter \\\n" +"-elementtype \"\" -type relation\n" +"::xotcl::InterceptorSlot create ${os}::Class::slot::mixin \\\n" +"-type relation -methodname class-mixin\n" +"::xotcl::InterceptorSlot create ${os}::Class::slot::filter \\\n" +"-type relation -methodname filter-mixin\n" +"::xotcl::InterceptorSlot create ${os}::Class::slot::object-mixin \\\n" +"-type relation\n" +"::xotcl::InterceptorSlot create ${os}::Class::slot::object-filter \\\n" "-elementtype \"\" -type relation}\n" "::xotcl::register_system_slots ::xotcl2\n" "::xotcl::MetaSlot __invalidateobjectparameter\n"