Index: generic/predefined.xotcl =================================================================== diff -u -r9ebd1309a52b27ab92e9e3cce07037767efe4a4f -r8f79347327f3c5f73faf86e87ebd6c8306265fbb --- generic/predefined.xotcl (.../predefined.xotcl) (revision 9ebd1309a52b27ab92e9e3cce07037767efe4a4f) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision 8f79347327f3c5f73faf86e87ebd6c8306265fbb) @@ -214,6 +214,10 @@ set parameterdefinitions [list] set slots [::xotcl2::objectInfo slotobjects $obj] foreach slot $slots { + # skip some lots for xotcl1; TODO: maybe different parameterFromSlots for xotcl1? + if {[::xotcl::is $obj type ::xotcl::Object] && + ([$slot name] eq "mixin" || [$slot name] eq "filter") + } continue set parameterdefinition "-[namespace tail $slot]" set opts [list] @@ -250,7 +254,10 @@ if {[::xotcl::is [self] class]} { lappend parameterdefinitions -parameter:method,optional } - lappend parameterdefinitions -noinit:method,optional,noarg -volatile:method,optional,noarg arg:initcmd,optional + lappend parameterdefinitions \ + -noinit:method,optional,noarg \ + -volatile:method,optional,noarg \ + arg:initcmd,optional # for the time being, use: #lappend parameterdefinitions args #puts stderr "*** parameter definition for [self]: $parameterdefinitions" @@ -319,6 +326,7 @@ {manager "[::xotcl::self]"} {multivalued false} {per-object false} + {forward-per-object} {required false} default type @@ -376,7 +384,9 @@ # since the domain object might be xotcl1 or 2, use dispatch ::xotcl::dispatch ${.domain} ::xotcl::cmd::Class::forward \ {*}[expr {${.per-object} ? "-per-object" : ""}] ${.name} \ - -default [${.manager} defaultmethods] ${.manager} %1 %self %proc + -default [${.manager} defaultmethods] ${.manager} %1 %self \ + {*}[expr {[info exists .forward-per-object] ? "-per-object" : ""}] \ + %proc } } @@ -389,11 +399,12 @@ {elementtype ::xotcl2::Class} } ::xotcl::relation ::xotcl::InfoSlot superclass ::xotcl::Slot -::xotcl::InfoSlot method get {obj prop} {$obj info $prop} -::xotcl::InfoSlot method add {obj prop value {pos 0}} { +::xotcl::InfoSlot method get {obj -per-object:switch prop} {$obj info $prop} +::xotcl::InfoSlot method add {obj -per-object:switch prop value {pos 0}} { if {![set .multivalued]} { error "Property $prop of ${.domain}->$obj ist not multivalued" } + puts stderr "adding infoslot: $obj $prop [linsert [$obj info $prop] $pos $value]" $obj $prop [linsert [$obj info $prop] $pos $value] } ::xotcl::InfoSlot method delete {-nocomplain:switch obj prop value} { @@ -433,7 +444,7 @@ ::xotcl::alias ::xotcl::InterceptorSlot set ::xotcl::relation ;# for backwards compatibility ::xotcl::alias ::xotcl::InterceptorSlot assign ::xotcl::relation -::xotcl::InterceptorSlot method add {obj prop value {pos 0}} { +::xotcl::InterceptorSlot method add {obj -per-object:switch prop value {pos 0}} { if {![set .multivalued]} { error "Property $prop of ${.domain}->$obj ist not multivalued" }