Index: doc/Class.man =================================================================== diff -u -rd4588fec011c3a8f3529ad25d3d2e033f7055b6e -r496978cf0b0f707fb82cd16eba99b2e44497e9ed --- doc/Class.man (.../Class.man) (revision d4588fec011c3a8f3529ad25d3d2e033f7055b6e) +++ doc/Class.man (.../Class.man) (revision 496978cf0b0f707fb82cd16eba99b2e44497e9ed) @@ -59,14 +59,14 @@ If [arg superClassNames] is not specified, returns the superclasses of the class. If provided, the class becomes the subclass of [arg superClassNames]. -[opt_def -filter [opt [arg filterSpecs]]] +[opt_def -filters [opt [arg filterSpecs]]] Retrieves the list of filter methods currently active on instances of the class, if [arg filterSpecs] is not set. Otherwise, activates a list of filter methods for the instances of the class. Filters are returned or set in terms of a list of [term "filter specification"]s. -[opt_def -mixin [opt [arg mixinSpecs]]] +[opt_def -mixins [opt [arg mixinSpecs]]] Returns the list of [term "mixin class"]es currently active on instances of the class, if [arg mixinSpecs] is not specified. Otherwise, the class @@ -153,7 +153,7 @@ [list_end] -[cmd_def filter] +[cmd_def filters] [list_begin definitions] @@ -214,13 +214,13 @@ default) will have contained both in the returned list. -[call [arg cls] [method "info subclass"] [opt [option -closure]] [opt [option -dependent]] [opt [arg pattern]]] +[call [arg cls] [method "info subclasses"] [opt [option -closure]] [opt [option -dependent]] [opt [arg pattern]]] If [arg pattern] is not specified, returns a list of the object names of all the direct and/or indirect subclasses of [arg cls]. If the [term "switch"] [option -closure] is set, indirect subclasses are also returned; otherwise, only direct subclasses will be returned. If the [term "switch"] [option -dependent] is on, indirect subclasses introduced by [term "mixin class"] relations of subclasses of [arg cls] are also reported. [option -closure] and [option -dependent] are mutually exclusive. If [arg pattern] is specified, only subclasses whose names match [arg pattern] will be listed (see [cmd "string match"]). -[call [arg cls] [method "info superclass"] [opt [option -closure]] [opt [arg pattern]]] +[call [arg cls] [method "info superclasses"] [opt [option -closure]] [opt [arg pattern]]] If [arg pattern] is not specified, returns a list of the object names of all the direct and/or indirect superclasses of [arg cls]. If the [term "switch"] [option -closure] is @@ -239,7 +239,7 @@ [list_end] -[cmd_def mixin] +[cmd_def mixins] [list_begin definitions] [include mixin.man.inc] Index: doc/Object.man =================================================================== diff -u -r8611e39b6778504101735a118a682dc0aac99d0c -r496978cf0b0f707fb82cd16eba99b2e44497e9ed --- doc/Object.man (.../Object.man) (revision 8611e39b6778504101735a118a682dc0aac99d0c) +++ doc/Object.man (.../Object.man) (revision 496978cf0b0f707fb82cd16eba99b2e44497e9ed) @@ -75,27 +75,20 @@ Retrieves the current class of the object or sets the object's class to [arg className], if provided. -[opt_def -object-filter [arg filterMethods]] +[opt_def -object-filters [arg filterMethods]] Retrieves the list of currently active per-object filter methods or sets a list of per-object filter methods, if [arg filterMethods] is provided. -[opt_def -object-mixin [arg mixinSpecs]] +[opt_def -object-mixins [arg mixinSpecs]] -Retrieves the list of currently active per-object mixin specifications -or sets a list of per-object mixin specifications to become -active. [arg mixinSpecs] is of the form of ... +If [arg mixinSpecs] is not specified, retrieves the list of currently +active per-object mixin specifications. If [arg mixinSpecs] is +specified, sets a list of per-object mixin specifications to become +active. [term "mixin class"]es are returned or set in terms of a list +of [term "mixin specification"]s. -[comment { - [opt_def -volatile] - - A volatile object is automatically destroyed (see [method destroy]) - when, during program execution, the variable scope, in which [option -volatile] was - configured for a given object for the first time (e.g., the call frame - of a proc), is cleaned up. -}] - [list_end] [section {Methods for Instances of nx::Object}] @@ -362,7 +355,7 @@ [list_end] -[cmd_def filter] +[cmd_def filters] [list_begin definitions] @@ -609,7 +602,7 @@ [list_end] -[cmd_def mixin] +[cmd_def mixins] [list_begin definitions] [include mixin.man.inc] Index: doc/filter.man.inc =================================================================== diff -u -re5ad7edaed3418723ed31bda80c8639df6b44a7e -r496978cf0b0f707fb82cd16eba99b2e44497e9ed --- doc/filter.man.inc (.../filter.man.inc) (revision e5ad7edaed3418723ed31bda80c8639df6b44a7e) +++ doc/filter.man.inc (.../filter.man.inc) (revision 496978cf0b0f707fb82cd16eba99b2e44497e9ed) @@ -2,54 +2,69 @@ [keywords "method filter"] -[call [arg [vset CMD]] [const [vset MODIFIER]] [method filter] [arg submethod] [opt "[arg arg] ..."]] +[call [arg [vset CMD]] [const [vset MODIFIER]] [method filters] [arg submethod] [opt "[arg arg] ..."]] Accesses and modifies the list of methods which are registered as [term "filter"]s with [arg obj] using a specific setter or getter [arg submethod]: [list_begin definitions] -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filter set}] [arg filterSpecList]"] -[arg filterSpecList] takes a list of [term "filter"] specs, with each spec being itself either a -one-element or a two-element list: [arg methodName] ?-guard [arg guardExpr]?. [arg methodName] identifies -an existing method of [arg [vset CMD]] which becomes -registered as a filter. If having three elements, the third -element [arg guardExpr] will be stored as a guard expression of the -[term "filter"]. This guard expression must be a valid Tcl expression -(see [cmd expr]). [arg expr] is evaluated when [arg [vset CMD]] receives a message to determine whether the -filter should intercept the message. Guard expressions -allow for realizing context-dependent or conditional filter -composition. - -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filter get}]"] -Returns the current list of methods registered as [term "filter"]s. - -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filter add}] [arg spec] [opt [arg index]]"] +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filters add}] [arg spec] [opt [arg index]]"] Inserts a single [term "filter"] into the current list of [term "filter"]s of [arg [vset CMD]]. Using [arg index], a position in the existing list of [term "filter"]s for inserting the new [term "filter"] can be set. If omitted, [arg index] defaults to the list head (0). -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filter delete}] [option -nocomplain] [arg specPattern]"] +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filters clear}]"] +Removes all [term "filter"]s from [arg [vset CMD]] and returns the list of removed [term "filter"]s. Clearing +is equivalent to passing an empty list for [arg filterSpecList] to +[const [vset SCOPE]] [method {filter set}]. + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filters get}]"] +Returns the list of current [term "filter specification"]s registered for [vset CMD]. + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filters delete}] [option -nocomplain] [arg specPattern]"] Removes a single [term "filter"] from the current list of [term "filter"]s of [arg [vset CMD]] whose spec matches [arg specPattern]. [arg specPattern] can -contain special matching chars (see [cmd "string match"]). [const [vset SCOPE]] [method "filter delete"] will +contain special matching chars (see [cmd "string match"]). [const [vset SCOPE]] [method "filters delete"] will throw an error if there is no matching [term "filter"], unless [option -nocomplain] is set. -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filter clear}]"] -Removes all [term "filter"]s from [arg [vset CMD]] and returns the list of removed [term "filter"]s. Clearing is equivalent -to passing an empty list for [arg filterSpecList] to [const [vset SCOPE]] [method {filter set}]. +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filters guard}] [arg methodName] [opt [arg expr]]"] -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filter guard}] [arg methodName] [arg expr]"] - -Registers a guard expression [arg expr] with a filter [arg methodName] -in a separate step, once the filter was set or added using [const [vset MODIFIER]] [method {filter set}] or -[const [vset MODIFIER]] [method {filter add}]. [arg expr] must be a valid Tcl expression (see +If [arg expr] is specified, registers a guard expression [arg expr] with a filter [arg methodName]. This requires that the filter [arg methodName] has been previously set using [const [vset MODIFIER]] [method {filters set}] or added using +[const [vset MODIFIER]] [method {filters add}]. [arg expr] must be a valid Tcl expression (see [cmd expr]). An empty string for [arg expr] will clear the currently registered guard expression for filter [arg methodName]. +[para] + +If [arg expr] is omitted, returns the guard expression set on the +[term "filter"] [arg methodName] defined for [arg [vset CMD]]. If none +is available, an empty string will be returned. + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method "filters methods"] [opt [arg pattern]]"] + +If [arg pattern] is omitted, returns all filter names which are +defined by [arg obj]. By specifying [arg pattern], the returned +filters can be limited to those whose names match [arg patterns] (see +[cmd "string match"]). + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {filters set}] [arg filterSpecList]"] + +[arg filterSpecList] takes a list of [term "filter"] specs, with each spec being itself either a +one-element or a two-element list: [arg methodName] ?-guard [arg guardExpr]?. [arg methodName] identifies +an existing method of [arg [vset CMD]] which becomes +registered as a filter. If having three elements, the third +element [arg guardExpr] will be stored as a guard expression of the +[term "filter"]. This guard expression must be a valid Tcl expression +(see [cmd expr]). [arg expr] is evaluated when [arg [vset CMD]] receives a message to determine whether the +filter should intercept the message. Guard expressions +allow for realizing context-dependent or conditional filter +composition. + + [list_end] Every [arg methodName] in a [arg spec] must resolve to an existing method in the scope of the [vset SCOPE]. To access and to manipulate the list of [term "filter"]s of [arg [vset CMD]], -[method cget]|[method configure] [option -[vset MODIFIER]-filter] can also be used. +[method cget]|[method configure] [option -[join [list {*}[vset MODIFIER] filters] -]] can also be used. Index: doc/info.man.inc =================================================================== diff -u -re5ad7edaed3418723ed31bda80c8639df6b44a7e -r496978cf0b0f707fb82cd16eba99b2e44497e9ed --- doc/info.man.inc (.../info.man.inc) (revision e5ad7edaed3418723ed31bda80c8639df6b44a7e) +++ doc/info.man.inc (.../info.man.inc) (revision 496978cf0b0f707fb82cd16eba99b2e44497e9ed) @@ -9,28 +9,16 @@ [keywords "method handle"] [keywords "method path"] -[call [arg [vset CMD]] [method "info [vset MODIFIER] filter"] [arg option] [opt "[arg arg] ..."]] +[call [arg [vset CMD]] [method "info [vset MODIFIER] filters"] [opt [option -guards]] [opt [arg pattern]]] -[list_begin definitions] - -[def "[arg [vset CMD]] [method "info [vset MODIFIER] filter methods"] [opt [option -guards]] [opt [arg pattern]]"] - - If [arg pattern] is omitted, returns all filter names which are -defined by [arg obj]. By turning on the [term switch] [option -guards], -the corresponding guard expressions, if any, are also -reported along with each filter as a three-element list: [arg filterName] --guard [arg guardExpr]. The returned filters can be limited to those whose names -match [arg patterns] (see [cmd "string match"]). +defined by [vset CMD]. By turning on the [term switch] [option -guards], the +corresponding guard expressions, if any, are also +reported along with each filter as a three-element list: [arg filterName] -guard +[arg guardExpr]. By specifying [arg pattern], the +returned filters can be limited to those whose names match [arg patterns] (see +[cmd "string match"]). -[def "[arg [vset CMD]] [method "info [vset MODIFIER] filter guard"] [arg name]"] - -Returns the guard expression set on the [term "filter"] [arg name] -defined for [arg obj]. If none is available, an empty string will -be returned. - -[list_end] - [call [arg [vset CMD]] [method "info [vset MODIFIER] method"] [arg option] [arg methodName]] This introspection [term "submethod"] provides access to the details @@ -105,28 +93,16 @@ }] [list_end] -[call [arg [vset CMD]] [method "info [vset MODIFIER] mixin"] [arg option] [opt "[arg arg] ..."]] +[call [arg [vset CMD]] [method "info [vset MODIFIER] mixins"] [opt [option -guards]] [opt [arg pattern]]] -[list_begin definitions] - -[def "[arg [vset CMD]] [method "info [vset MODIFIER] mixin classes"] [opt [option -guards]] [opt [arg pattern]]"] - If [arg pattern] is omitted, returns the object names of the [term "mixin class"]es which -extend [arg obj] directly. By turning on the [term switch] [option -guards], +extend [arg [vset CMD]] directly. By turning on the [term switch] [option -guards], the corresponding guard expressions, if any, are also reported along with each mixin as a three-element list: [arg className] -guard [arg guardExpr]. The returned [term "mixin class"]es can be limited to those whose names match [arg patterns] (see [cmd "string match"]). -[def "[arg [vset CMD]] [method "info [vset MODIFIER] mixin guard"] [arg name]"] -For the [term "mixin class"] [arg name] which extends -[arg obj] directly, returns the corresponding guard expression, if -any. If none is available, an empty string will be returned. - -[list_end] - - [call [arg [vset CMD]] [method "info [vset MODIFIER] slots"] [opt "[option -type] [arg className]"] [arg pattern]] If [arg pattern] is not specified, returns the object names of all [term "slot object"]s defined by [arg obj]. The returned [term "slot object"]s can be limited according to any or a Index: doc/mixin.man.inc =================================================================== diff -u -re5ad7edaed3418723ed31bda80c8639df6b44a7e -r496978cf0b0f707fb82cd16eba99b2e44497e9ed --- doc/mixin.man.inc (.../mixin.man.inc) (revision e5ad7edaed3418723ed31bda80c8639df6b44a7e) +++ doc/mixin.man.inc (.../mixin.man.inc) (revision 496978cf0b0f707fb82cd16eba99b2e44497e9ed) @@ -3,15 +3,48 @@ [keywords "mixin class"] [keywords linearisation] -[call [arg [vset CMD]] [const [vset MODIFIER]] [method mixin] [arg submethod] [opt "[arg arg] ..."]] +[call [arg [vset CMD]] [const [vset MODIFIER]] [method mixins] [arg submethod] [opt "[arg arg] ..."]] Accesses and modifies the list of [term "mixin class"]es of [arg obj] using a specific setter or getter [arg submethod]: [list_begin definitions] -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixin set}] [arg mixinSpecList]"] -[arg mixinSpecList] takes a list of [term "mixin class"] specs, with each spec being itself either a one-element or a three-element list: [arg className] ?-guard [arg guardExpr]?. If +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixins add}] [arg spec] [opt [arg index]]"] +Inserts a single [term "mixin class"] into the current list of [term "mixin class"]es of [arg obj]. Using [arg index], a position in the existing list of [term "mixin class"]es for inserting the new [term "mixin class"] can be set. If +omitted, [arg index] defaults to the list head (0). +[comment {Therefore, by default, any added [term "mixin class"] takes precedence over previously added classes in the overall linearisation of [arg obj].}] + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method "mixins classes"] [opt [arg pattern]]"] + +If [arg pattern] is omitted, returns the object names of the [term "mixin class"]es which +extend [arg [vset CMD]] directly. By specifying [arg pattern], the returned [term "mixin class"]es can +be limited to those whose names match [arg pattern] (see [cmd "string match"]). + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixins clear}]"] +Removes all [term "mixin class"]es from [arg obj] and returns the list of removed [term "mixin class"]es. Clearing is equivalent to passing an empty list for [arg mixinSpecList] to +[const [vset MODIFIER]] [method {mixins set}]. + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixins delete}] [option -nocomplain] [arg specPattern]"] +Removes a [term "mixin class"] from a current list of [term "mixin class"]es of [arg obj] whose spec matches [arg specPattern]. [arg specPattern] can contain special matching chars (see [cmd "string match"]). [const [vset SCOPE]] [method "mixins delete"] will throw an error if there is no matching [term "mixin class"], unless [option -nocomplain] is set. + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixins get}]"] +Returns the list of current [term "mixin specification"]s. + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixins guard}] [arg className] [opt [arg expr]]"] + +If [arg expr] is specified, a guard expression [arg expr] is registered with the [term "mixin class"] [arg className]. This requires that the corresponding [term "mixin class"] [arg className] has been previously set using [const [vset SCOPE]] [method {mixins set}] or added using [const [vset MODIFIER]] [method {mixins add}]. [arg expr] must be a valid Tcl expression (see +[cmd expr]). An empty string for [arg expr] will clear the currently registered +guard expression for the [term "mixin class"] [arg className]. + +[para] + +If [arg expr] is not specified, returns the active guard +expression. If none is available, an empty string will be returned. + +[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixins set}] [arg mixinSpecList]"] + +[arg mixinSpecList] represents a list of [term "mixin class"] specs, with each spec being itself either a one-element or a three-element list: [arg className] ?-guard [arg guardExpr]?. If having one element, the element will be considered the [arg className] of the [term "mixin class"]. If having three elements, the third element [arg guardExpr] will be stored as a guard expression of the @@ -21,26 +54,6 @@ allow for realizing context-dependent or conditional mixin composition. -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixin get}]"] -Returns the current list of [term "mixin class"]es. -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixin add}] [arg spec] [opt [arg index]]"] -Inserts a single [term "mixin class"] into the current list of [term "mixin class"]es of [arg obj]. Using [arg index], a position in the existing list of [term "mixin class"]es for inserting the new [term "mixin class"] can be set. If -omitted, [arg index] defaults to the list head (0). -[comment {Therefore, by default, any added [term "mixin class"] takes precedence over previously added classes in the overall linearisation of [arg obj].}] -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixin delete}] [option -nocomplain] [arg specPattern]"] -Removes a [term "mixin class"] from a current list of [term "mixin class"]es of [arg obj] whose spec matches [arg specPattern]. [arg specPattern] can contain special matching chars (see [cmd "string match"]). [const [vset SCOPE]] [method "mixin delete"] will throw an error if there is no matching [term "mixin class"], unless [option -nocomplain] is set. - -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixin clear}]"] -Removes all [term "mixin class"]es from [arg obj] and returns the list of removed [term "mixin class"]es. Clearing is equivalent to passing an empty list for [arg mixinSpecList] to -[const [vset SCOPE]] [method {mixin set}]. - -[def "[arg [vset CMD]] [const [vset MODIFIER]] [method {mixin guard}] [arg className] [arg expr]"] - -Registers a guard expression [arg expr] with the [term "mixin class"] [arg className] -in a separate step, once the [term "mixin class"] was set or added using [const [vset SCOPE]] [method {mixin set}] or -[const [vset MODIFIER]] [method {mixin add}]. [arg expr] must be a valid Tcl expression (see -[cmd expr]). An empty string for [arg expr] will clear the currently registered -guard expression for the registered [term "mixin class"] [arg className]. [list_end] [comment { A [term "mixin class"] whose spec is featured earlier in [arg mixinSpecList] takes @@ -49,7 +62,7 @@ overall [term linearisation] of [arg obj] guarantees to maintain this local order of [term "mixin class"]es. }] -At the time of setting the mixin relation, that is, calling [const [vset MODIFIER]] [method mixin], every +At the time of setting the mixin relation, that is, calling [const [vset MODIFIER]] [method mixins], every [arg className] as part of a spec must be an existing instance of [cmd nx::Class]. To access and to manipulate the list of [term "mixin class"]es of [arg obj], -[method cget]|[method configure] [option -[vset MODIFIER]-mixin] can also be used. +[method cget]|[method configure] [option -[join [list {*}[vset MODIFIER] mixins] -]] can also be used.