Index: xotcl/generic/predefined.h =================================================================== diff -u -r9722a51911e1502444c173306c8c88f7f3888989 -r5ce5a10c82bc948f50fc4542f844dcd50de1eae3 --- xotcl/generic/predefined.h (.../predefined.h) (revision 9722a51911e1502444c173306c8c88f7f3888989) +++ xotcl/generic/predefined.h (.../predefined.h) (revision 5ce5a10c82bc948f50fc4542f844dcd50de1eae3) @@ -1,5 +1,5 @@ static char cmd[] = -"# $Id: predefined.h,v 1.2 2004/07/02 11:22:31 neumann Exp $\n" +"# $Id: predefined.h,v 1.3 2004/07/03 21:19:39 neumann Exp $\n" "::xotcl::Object instproc init args {}\n" "::xotcl::Object create ::xotcl::@\n" "::xotcl::@ proc unknown args {}\n" @@ -8,23 +8,49 @@ "::xotcl::Object instforward $cmd -objscope}\n" "::xotcl::Object instproc tclcmd {t} {\n" "set cmd [list [::xotcl::self] forward $t -objscope]\n" -"puts stderr \"the method tclcmd is deprecated; use instead '$cmd'\"\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" "eval $cmd}\n" "::xotcl::Class instproc insttclcmd {t} {\n" "set cmd [list [::xotcl::self] instforward $t -objscope]\n" -"puts stderr \"the method tclcmd is deprecated; use instead '$cmd'\"\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" "eval $cmd}\n" +"::xotcl::Class ::xotcl::Relations\n" +"::xotcl::Relations instproc get {obj prop} {$obj info $prop}\n" +"::xotcl::Relations instproc set {obj prop value} {::xotcl::setrelation $obj $prop $value}\n" +"::xotcl::Relations instproc add {obj prop value {pos 0}} {\n" +"$obj $prop [linsert [$obj info $prop -guards] $pos $value]}\n" +"::xotcl::Relations instproc delete {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" +"error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" +"::xotcl::Relations instproc unknown {m args} {\n" +"puts \"method '$m' unknown for [self]\"\n" +"puts \" valid commands are: {[lsort [my info procs]]}\"}\n" +"::xotcl::Relations create ::xotcl::relmgr -requireNamespace\n" +"::xotcl::Object instforward mixin -default [list get set] xotcl::relmgr %1 %self %proc\n" +"::xotcl::Object instforward filter -default [list get set] xotcl::relmgr %1 %self %proc\n" +"::xotcl::Class instforward instmixin -default [list get set] xotcl::relmgr %1 %self %proc\n" +"::xotcl::Class instforward instfilter -default [list get set] xotcl::relmgr %1 %self %proc\n" "::xotcl::Object instproc self {} {return [::xotcl::self]}\n" "::xotcl::Object instproc defaultmethod {} {\n" "return [::xotcl::self]}\n" "::xotcl::Object instproc filterappend f {\n" -"::xotcl::my filter [concat [::xotcl::my info filter -guards] $f]}\n" +"set cmd [list [::xotcl::self] filter add $f end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Object instproc mixinappend m {\n" -"::xotcl::my mixin [concat [::xotcl::my info mixin] $m]}\n" +"set cmd [list [::xotcl::self] mixin add $m end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Class instproc instfilterappend f {\n" -"::xotcl::my instfilter [concat [::xotcl::my info instfilter -guards] $f]}\n" +"set cmd [list [::xotcl::self] instfilter add $f end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Class instproc instmixinappend m {\n" -"::xotcl::my instmixin [concat [::xotcl::my info instmixin] $m]}\n" +"set cmd [list [::xotcl::self] instmixin add $m end]\n" +"puts stderr \"the method [::xotcl::self proc] is deprecated; use instead '$cmd'\"\n" +"eval $cmd}\n" "::xotcl::Object instproc hasclass cl {\n" "if {[::xotcl::my ismixin $cl]} {return 1}\n" "::xotcl::my istype $cl}\n"