Index: doc/Object.man =================================================================== diff -u -N -r5c386b5e1011480621bf5134e9d232dd922d27f7 -r430801481ec743e9b44376bc82f1568ac165cdf7 --- doc/Object.man (.../Object.man) (revision 5c386b5e1011480621bf5134e9d232dd922d27f7) +++ doc/Object.man (.../Object.man) (revision 430801481ec743e9b44376bc82f1568ac165cdf7) @@ -631,83 +631,24 @@ [cmd_def alias] [list_begin definitions] -[call [arg obj] [opt "public | private | protected"] [const object] [cmd alias] [arg methodName] [opt "-returns [arg charConstraint]"] [opt "-frame object | method"] [arg cmdName]] -Define an <<@gls alias>> as per-object method. This method is used -for defining a method with the specified name by binding a -pre-existing implementation. This alias target is provided as the -last argument. +[call [arg obj] [opt "public | private | protected"] [const object] [cmd alias] [arg methodName] [opt "-returns [arg valueChecker]"] [opt "-frame object | method"] [arg cmdName]] -[list_begin arguments] +[include alias.man.inc] -[arg_def "" methodName in] Name of the new method - -[arg_def "" -returns in] -An optional character constraint to check the result value received -upon invoking on the alias method (e.g., [const integer]). - -[arg_def "" -frame in] - -Optional scoping information. If the provided -value is [const object] then variable references of the -command are created as instance variables. If the value -is [const method], then a method frame is pushed (the -method can resolve [cmd ::nx::self] or can call [cmd nx::next]). - -[arg_def "" cmdName in] - -A reference to an implementation. If the -implementation is a method, the value should be a -[term "[keywords {method handle}]"] (see [sectref-external xxx]), if it is a Tcl command, it should -be a fully qualified command name. - [list_end] -[list_end] [cmd_def delete] [list_begin definitions] -[call [arg obj] [cmd delete] [method object] [method property] [arg propertyName]] -[call [arg obj] [cmd delete] [method object] [method variable] [arg variableName]] -[call [arg obj] [cmd delete] [method object] [method method] [arg methodName]] +[include delete.man.inc] -[def "[method object] [method property]"] -Remove a previously defined property defined for the object. -[para] -Return value: ... -[list_begin arguments] - -[arg_def "" propertyName in] Unqualified name of the property which should be deleted. - [list_end] -[def "[method object] [method variable]"] -Remove a previously defined variable defined for the object. -[para] -Return value: ... -[list_begin arguments] - -[arg_def "" variableName in] Unqualified name of the variable which should be deleted. - [list_end] -[def "[method object] [method method]"] -Remove a previously defined method defined for the object. -[list_begin arguments] -[arg_def "" methodName in] Unqualified name of the method which should be deleted. - -[arg_def "" "(Return value)"] ... - -[list_end] - - -[list_end] - -[list_end] - - [section {Internally called Methods}] [cmd nx::Object] provides a set of default implementations for Index: doc/alias.man.inc =================================================================== diff -u -N --- doc/alias.man.inc (revision 0) +++ doc/alias.man.inc (revision 430801481ec743e9b44376bc82f1568ac165cdf7) @@ -0,0 +1,28 @@ +[comment {-*- tcl -*- manpage fragment for alias method, shared by nx::Object and nx::Class}] + +[keywords "alias method"] +[keywords "value checker"] +[keywords "method handle"] + +Define an [term "alias method"] for the given [vset SCOPE]. The +resulting method registers a pre-existing Tcl command [arg cmdName] +under the (alias) name [arg methodName] with the [vset SCOPE]. If [arg cmdName] refers +to another [method method], the corresponding argument +should be a valid [term "method handle"]. If a Tcl command (e.g., a +[cmd proc]), the argument should be a fully qualified Tcl command +name. If aliasing a subcommand (e.g., [cmd "array exists"]) of a Tcl namespace ensemble (e.g., [cmd array]), [arg cmdName] must hold the fully qualified subcommand name (and not the ensemble name of +the subcommand). + +[para] As for a regular [method "[vset SCOPE] method"], [option "-returns"] allows +for setting a [term "value checker"] on the values +returned by the [term "alias method"]. +[para] +When creating an [term "alias method"] for +a [emph C-implemented] Tcl command (i.e., command defined using the +Tcl/NX C-API), [opt [option -frame]] sets the scope +for variable references used in the aliased command. If the provided +value is [const object], then variable references will be resolved in the +context of the called object, i.e., the object upon which the [term "alias method"] is +invoked, as if they were object variables. There is no need for using +the colon-prefix notation for identifying object variables. If the +value is [const method], then the aliased command will be executed as a regular method call. The command is aware of its called-object context; i.e., it can resolve [cmd ::nx::self]. In addition, the [term "alias method"] has access to the method-call context (e.g., [cmd nx::next]). If [option "-frame"] is omitted, and by default, the variable references will resolve in the context of the caller of the [term "alias method"]. \ No newline at end of file Index: doc/delete.man.inc =================================================================== diff -u -N --- doc/delete.man.inc (revision 0) +++ doc/delete.man.inc (revision 430801481ec743e9b44376bc82f1568ac165cdf7) @@ -0,0 +1,16 @@ +[comment {-*- tcl -*- manpage fragment for delete method, shared by nx::Object and nx::Class}] + +[keywords "alias method"] +[keywords "forwarder method"] + +[call [arg obj] [method delete] [const [vset SCOPE]] [const property] [arg propertyName]] +[call [arg obj] [method delete] [const [vset SCOPE]] [const variable] [arg variableName]] +[call [arg obj] [method delete] [const [vset SCOPE]] [const method] [arg methodName]] + +Removes a property [arg propertyName], variable [arg variableName], +and method [arg methodNome], respectively, previously defined for the +scope of the [vset SCOPE]. This method is the equivalent to Tcl's [cmd rename] for +NX-specific constructs such as properties, object variables, and +methods. +[para] +[method "delete [const [vset SCOPE]] [const method]"] can be equally used for removing regular methods (see [method "[vset SCOPE] method"]), an [term "alias method"] (see [method "[vset SCOPE] alias"]), and a [term "forwarder method"] (see [method "[vset SCOPE] forward"]).