Index: TODO =================================================================== diff -u -rb531a50ecc43d0c13e2432b099a436c3260c7a49 -r377258585e6d0715ad1da6430c833f6f346326f7 --- TODO (.../TODO) (revision b531a50ecc43d0c13e2432b099a436c3260c7a49) +++ TODO (.../TODO) (revision 377258585e6d0715ad1da6430c833f6f346326f7) @@ -4337,7 +4337,7 @@ "/obj/ method require private method ..." were dropped -- added package nx::class to allow optionally the "class" notation +- added package nx::class-method to allow optionally the "class" notation "/cls/ class method ..." (and friends, see (a)), and "/cls/ class info ... Index: library/nx/class-method.tcl =================================================================== diff -u --- library/nx/class-method.tcl (revision 0) +++ library/nx/class-method.tcl (revision 377258585e6d0715ad1da6430c833f6f346326f7) @@ -0,0 +1,108 @@ +package provide nx::class-method 1.0 + +namespace eval ::nsf { + array set ::nsf::methodDefiningMethod { + class 1 + } +} + +namespace eval ::nx { + nx::Class eval { + :public alias "class method" ::nx::Object::slot::__object::method + + :public alias "class alias" ::nx::Object::slot::__object::alias + :public alias "class forward" ::nx::Object::slot::__object::forward + #:public method "class forward" args { + # puts stderr "CLASS CMD: [self] [current method] [current args]" + # :public object forward {*}$args + #} + + :public alias "class info" ::nx::Object::slot::__info + + :public method "class filter" args { + set what filter + switch [llength $args] { + 0 {return [::nsf::relation [::nsf::self] object-$what]} + 1 {return [::nsf::relation [::nsf::self] object-$what {*}$args]} + default {return [::nx::Object::slot::$what [lindex $args 0] \ + [::nsf::self] object-$what \ + {*}[lrange $args 1 end]] + } + } + } + :public method "class mixin" args { + set what mixin + switch [llength $args] { + 0 {return [::nsf::relation [::nsf::self] object-$what]} + 1 {return [::nsf::relation [::nsf::self] object-$what {*}$args]} + default {return [::nx::Object::slot::$what [lindex $args 0] \ + [::nsf::self] object-$what \ + {*}[lrange $args 1 end]] + } + } + } + :public alias "class filterguard" ::nsf::methods::object::filterguard + :public alias "class mixinguard" ::nsf::methods::object::mixinguard + + } + + # + # provide aliases for "class property" and "class variable" + # + ::nx::Class eval { + :alias "class property" ::nsf::classes::nx::Object::property + :alias "class variable" ::nsf::classes::nx::Object::variable + } + + # + # provide aliases for "class delete" + # + ::nx::Class eval { + :alias "class delete property" ::nx::Object::slot::__delete::property + :alias "class delete variable" ::nx::Object::slot::__delete::variable + :alias "class delete method" ::nx::Object::slot::__delete::method + } + + # + # info redirector + # + ::nx::Class eval { + :alias "class info" ::nx::Object::slot::__info + } + ###################################################################### + # Provide method "require" + ###################################################################### + Object eval { + # + # method require, base cases + # + :method "require class method" {methodName} { + ::nsf::method::require [::nsf::self] $methodName 1 + return [:info lookup method $methodName] + } + # + # method require, public explicitly + # + :method "require public class method" {methodName} { + set result [:require class method $methodName] + ::nsf::method::property [self] $result call-protected false + return $result + } + # + # method require, protected explicitly + # + :method "require protected class method" {methodName} { + set result [:require class method $methodName] + ::nsf::method::property [self] $result call-protected true + return $result + } + # + # method require, private explicitly + # + :method "require private class method" {methodName} { + set result [:require class method $methodName] + ::nsf::method::property [self] $result call-private true + return $result + } + } +} \ No newline at end of file Fisheye: Tag 377258585e6d0715ad1da6430c833f6f346326f7 refers to a dead (removed) revision in file `library/nx/class.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: library/nx/pkgIndex.tcl =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r377258585e6d0715ad1da6430c833f6f346326f7 --- library/nx/pkgIndex.tcl (.../pkgIndex.tcl) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ library/nx/pkgIndex.tcl (.../pkgIndex.tcl) (revision 377258585e6d0715ad1da6430c833f6f346326f7) @@ -9,5 +9,5 @@ # full path name of this file's directory. package ifneeded nx 2.0b4 [list source [file join $dir nx.tcl]] -package ifneeded nx::class 1.0 [list source [file join $dir class.tcl]] +package ifneeded nx::class-method 1.0 [list source [file join $dir class-method.tcl]] package ifneeded nx::plain-object-method 1.0 [list source [file join $dir plain-object-method.tcl]]