Index: TODO =================================================================== diff -u -re3a84e351aaf79c02a63cc0741dde7b9bd550849 -r596677fb3ed1e15dc62a04789781347fb3dbc369 --- TODO (.../TODO) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) +++ TODO (.../TODO) (revision 596677fb3ed1e15dc62a04789781347fb3dbc369) @@ -2438,6 +2438,8 @@ ::nsf::alias => ::nsf::method::alias ::nsf::forward => ::nsf::method::forward ::nsf::setter => ::nsf::method::setter + ::nsf::provide_method => ::nsf::method::provide + ::nsf::require_method => ::nsf::method::require (updated regression test, docs, ...) Index: generic/nsf.tcl =================================================================== diff -u -re3a84e351aaf79c02a63cc0741dde7b9bd550849 -r596677fb3ed1e15dc62a04789781347fb3dbc369 --- generic/nsf.tcl (.../nsf.tcl) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) +++ generic/nsf.tcl (.../nsf.tcl) (revision 596677fb3ed1e15dc62a04789781347fb3dbc369) @@ -17,11 +17,11 @@ # support for method provide and method require # - proc ::nsf::provide_method {require_name definition {script ""}} { + proc ::nsf::method::provide {require_name definition {script ""}} { set ::nsf::methodIndex($require_name) [list definition $definition script $script] } - proc ::nsf::require_method {object name {per_object 0}} { + proc ::nsf::method::require {object name {per_object 0}} { set key ::nsf::methodIndex($name) if {[info exists $key]} { array set "" [set $key] @@ -88,8 +88,8 @@ # # provide some popular methods for "method require" # - ::nsf::provide_method autoname {::nsf::method::alias autoname ::nsf::methods::object::autoname} - ::nsf::provide_method exists {::nsf::method::alias exists ::nsf::methods::object::exists} + ::nsf::method::provide autoname {::nsf::method::alias autoname ::nsf::methods::object::autoname} + ::nsf::method::provide exists {::nsf::method::alias exists ::nsf::methods::object::exists} # # exit handlers Index: generic/predefined.h =================================================================== diff -u -re3a84e351aaf79c02a63cc0741dde7b9bd550849 -r596677fb3ed1e15dc62a04789781347fb3dbc369 --- generic/predefined.h (.../predefined.h) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) +++ generic/predefined.h (.../predefined.h) (revision 596677fb3ed1e15dc62a04789781347fb3dbc369) @@ -4,9 +4,9 @@ "namespace eval ::nsf::method::create {\n" "namespace export alias}\n" "namespace export configure finalize interp is my relation\n" -"proc ::nsf::provide_method {require_name definition {script \"\"}} {\n" +"proc ::nsf::method::provide {require_name definition {script \"\"}} {\n" "set ::nsf::methodIndex($require_name) [list definition $definition script $script]}\n" -"proc ::nsf::require_method {object name {per_object 0}} {\n" +"proc ::nsf::method::require {object name {per_object 0}} {\n" "set key ::nsf::methodIndex($name)\n" "if {[info exists $key]} {\n" "array set \"\" [set $key]\n" @@ -33,8 +33,8 @@ "set oldSetting [::nsf::relation $object $rel]\n" "uplevel [list ::nsf::relation $object $rel [linsert $oldSetting 0 $classes]]} else {\n" "uplevel [list ::nsf::relation $object $rel \"\"]}}\n" -"::nsf::provide_method autoname {::nsf::method::alias autoname ::nsf::methods::object::autoname}\n" -"::nsf::provide_method exists {::nsf::method::alias exists ::nsf::methods::object::exists}\n" +"::nsf::method::provide autoname {::nsf::method::alias autoname ::nsf::methods::object::autoname}\n" +"::nsf::method::provide exists {::nsf::method::alias exists ::nsf::methods::object::exists}\n" "proc ::nsf::exithandler {args} {\n" "lassign $args op value\n" "switch $op {\n" Index: library/nx/nx.tcl =================================================================== diff -u -re3a84e351aaf79c02a63cc0741dde7b9bd550849 -r596677fb3ed1e15dc62a04789781347fb3dbc369 --- library/nx/nx.tcl (.../nx.tcl) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) +++ library/nx/nx.tcl (.../nx.tcl) (revision 596677fb3ed1e15dc62a04789781347fb3dbc369) @@ -364,11 +364,11 @@ class-object { set what [lindex $args 0] if {$what eq "method"} { - ::nsf::require_method [::nsf::self] [lindex $args 1] 1 + ::nsf::method::require [::nsf::self] [lindex $args 1] 1 } } method { - ::nsf::require_method [::nsf::self] [lindex $args 0] 0 + ::nsf::method::require [::nsf::self] [lindex $args 0] 0 } namespace { ::nsf::dispatch [::nsf::self] ::nsf::methods::object::requirenamespace Index: nsf.nxd =================================================================== diff -u -re03b655a792c452a2c1a76d479732e3fbadd7093 -r596677fb3ed1e15dc62a04789781347fb3dbc369 --- nsf.nxd (.../nsf.nxd) (revision e03b655a792c452a2c1a76d479732e3fbadd7093) +++ nsf.nxd (.../nsf.nxd) (revision 596677fb3ed1e15dc62a04789781347fb3dbc369) @@ -966,11 +966,11 @@ # '''object-filter''' and # '''class-filter'''). -# @command provide_method +# @command ::nsf::method::provide # # The command contributes an entry to a '''interp'''-wide method # repository (the method index) to be queried and harvested by -# <<@command require_method>>. An entry consists of a unique +# <<@command ::nsf::method::require>>. An entry consists of a unique # identifier, a definition script, and a setup script. Arbitrary # objects can request method definitions from this repository in a # disciplined manner. The idea of this method repository ressembles @@ -985,9 +985,9 @@ # before defining the method on the # requiring object. -# @command require_method +# @command ::nsf::method::require # -# As the counterpart of <<@command provide_method>>, the command allows +# As the counterpart of <<@command ::nsf::method::provide>>, the command allows # you to require an method definition for the given object from the # '''interp'''-wide method repository. # Index: tests/doc.test =================================================================== diff -u -re3a84e351aaf79c02a63cc0741dde7b9bd550849 -r596677fb3ed1e15dc62a04789781347fb3dbc369 --- tests/doc.test (.../doc.test) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) +++ tests/doc.test (.../doc.test) (revision 596677fb3ed1e15dc62a04789781347fb3dbc369) @@ -1098,9 +1098,9 @@ ::nsf::isobject ::nsf::method ::nsf::method::property - ::nsf::provide_method + ::nsf::method::provide ::nsf::qualify - ::nsf::require_method + ::nsf::method::require ::nsf::setter ::nsf::setvar } Index: tests/method-require.test =================================================================== diff -u -re3a84e351aaf79c02a63cc0741dde7b9bd550849 -r596677fb3ed1e15dc62a04789781347fb3dbc369 --- tests/method-require.test (.../method-require.test) (revision e3a84e351aaf79c02a63cc0741dde7b9bd550849) +++ tests/method-require.test (.../method-require.test) (revision 596677fb3ed1e15dc62a04789781347fb3dbc369) @@ -13,13 +13,13 @@ # producing these.... # - nsf::provide_method append {::nsf::method::alias append -frame object ::append} - nsf::provide_method lappend {::nsf::method::alias lappend -frame object ::lappend} - nsf::provide_method set {::nsf::method::alias set -frame object ::set} - nsf::provide_method tcl::set {::nsf::method::alias set -frame object ::set} - nsf::provide_method exists {::nsf::method::alias exists ::nsf::methods::object::exists} - nsf::provide_method foo {::nsf::method::create foo {x y} {return x=$x,y=$y}} - nsf::provide_method x {::nsf::mixin ::MIX} { + nsf::method::provide append {::nsf::method::alias append -frame object ::append} + nsf::method::provide lappend {::nsf::method::alias lappend -frame object ::lappend} + nsf::method::provide set {::nsf::method::alias set -frame object ::set} + nsf::method::provide tcl::set {::nsf::method::alias set -frame object ::set} + nsf::method::provide exists {::nsf::method::alias exists ::nsf::methods::object::exists} + nsf::method::provide foo {::nsf::method::create foo {x y} {return x=$x,y=$y}} + nsf::method::provide x {::nsf::mixin ::MIX} { # here could be as well a package require, etc. ::nx::Class create ::MIX {:public method x {} {return x}} }