Index: xotcl/doc/langRef.xotcl =================================================================== diff -u -r225b8b992e16760eca2a7fa7bf51533499c7cc84 -r638782f84b31e4ebfd00529381e280c70f9950bc --- xotcl/doc/langRef.xotcl (.../langRef.xotcl) (revision 225b8b992e16760eca2a7fa7bf51533499c7cc84) +++ xotcl/doc/langRef.xotcl (.../langRef.xotcl) (revision 638782f84b31e4ebfd00529381e280c70f9950bc) @@ -1,5 +1,5 @@ -# $Id: langRef.xotcl,v 1.2 2004/07/20 12:57:59 neumann Exp $ -package provide XOTcl-langRef 1.2 +# $Id: langRef.xotcl,v 1.3 2004/08/17 10:12:55 neumann Exp $ +package provide XOTcl-langRef 1.3 package require Tcl @ @File { @@ -63,7 +63,7 @@ <@/p> } - date { $Date: 2004/07/20 12:57:59 $ } + date { $Date: 2004/08/17 10:12:55 $ } } ## @@ -253,29 +253,20 @@ } @ Object instproc filter { - filterList "list of methods that should be registered as filters" + args "filter specification" } { Description { - Specifies the list of filters registered for the class. - <@tt>filter overwrites all previous setting. - Filters must be available on the class or its heritage - order. Filters may also reside on the meta-class of the class. - - Filter list may contain filter guards. Then the - filter is composed of two list elements: {filtername filterguard}. + If <@tt>$args is one argument, it specifies a list of filters to + be set. Every filter must be an XOTcl proc/instproc within + the object scope. + If <@tt>$args it has more argument, the first one specifies the + action. Possible values are <@tt>set, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the tutorial. } - return "empty string" + return "if <@tt>$args return empty current filters, otherwise empty" } -@ Object instproc filterappend { - filterList "name of the new filter" -} { - description { - Convenience method that appends a filter to the existing filters of the object. - } - return "empty string" -} - @ Object instproc filterguard { filtername "filter name of a registered filter" guard "set of conditions to execute the filter" @@ -300,6 +291,43 @@ return "full qualified name, if filter is found, otherwise an empty string" } + +@ Object instproc forward { + name "name of forwarder method" + ?options? "-objscope, -methodprefix string, -default names" + ?callee? "named of the called command or object" + ?args? "arguments" + +} { + Description { + Register a method (similar to a proc) for forwarding calls to + a callee (target tcl command, + other object). If the forwarder method is called, the actual arguments + of the invocation are appended to the specified arguments. In callee an + arguments certain substituions can take place: + + Additionally each argument can be prefixed by the positional prefix %@POS + (note the delimiting space at the end) that can be used to specify an + explicit position. POS can be a positive or negative integer or the word + end. The positional arguments are evaluated from left to + right and should be used in ascending order. valid Options are: + + See tutorial for detailed examples. + } + return "empty" +} + + @ Object instproc hasclass { ?className? "name of a class to be tested" } { @@ -513,25 +541,20 @@ return "empty string" } -@ Object instproc mixin { - mixinList "list of classes that should be registered as mixins" +@ Object instproc mixin { + args "mixin specification" } { Description { - Specifies the list of mixins registered for the object. - The method <@tt>mixin overwrites all previous settings. + If <@tt>$args is one argument, it specifies a list of mixins to + be set. Every mixin must be a defined class. + If <@tt>$args has more argument, the first one specifies the + action. Possible values are <@tt>set, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the tutorial. } - return "empty string" + return "if <@tt>$args empty return current mixins, otherwise empty" } -@ Object instproc mixinappend { - mixinList "name of the new mixin" -} { - description { - Convenience method that appends a mixin to the existing mixins of the object. - } - return "empty string" -} - @ Object instproc move { newName "destination of move operation" } { @@ -887,29 +910,23 @@ } @ Class instproc instfilter { - filterList "list of methods that should be registered as filters" + args "instfilter specification" } { Description { - Specifies the list of filters registered for the class. - <@tt>instfilter overwrites all previous setting. - Filters must be available on the class or its heritage - order. Filters may also reside on the meta-class of the class. - - Filter list may contain filter guards. Then the - filter is composed of two list elements: {filtername filterguard}. + If <@tt>$args is one argument, it specifies a list of + instfilters to + be set. Every filter must be an XOTcl proc/instproc within + the object scope. + If <@tt>$args it has more argument, the first one specifies the + action. Possible values are <@tt>set, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the tutorial. } - return "empty string" + return "if <@tt>$args return empty current instfilters, otherwise empty" } -@ Class instproc instfilterappend { - filterList "name of the new instfilter" -} { - description { - Convenience method that appends an instfilter to the existing filters of the class. - } - return "empty string" -} + @ Class instproc instfilterguard { filtername "filter name of a registered filter" guard "set of conditions to execute the filter" @@ -923,6 +940,42 @@ } +@ Class instproc instforward { + name "name of forwarder method" + ?options? "-objscope, -methodprefix string, -default names" + ?callee? "named of the called command or object" + ?args? "arguments" + +} { + Description { + Register a method (similar to an instproc) for forwarding calls to + a callee (target tcl command, + other object). If the forwarder method is called, the actual arguments + of the invocation are appended to the specified arguments. In callee an + arguments certain substituions can take place: + + Additionally each argument can be prefixed by the positional prefix %@POS + (note the delimiting space at the end) that can be used to specify an + explicit position. POS can be a positive or negative integer or the word + end. The positional arguments are evaluated from left to + right and should be used in ascending order. valid Options are: + + See tutorial for detailed examples. + } + return "empty" +} + + @ Class instproc instinvar { invariantList "Body of invariants for the class" } { @@ -935,25 +988,19 @@ } @ Class instproc instmixin { - instmixinList "list of classes that should be registered as instmixins" + args "instmixin specification" } { Description { - Specifies the list of instmixins (per-class mixins) for the class. - Note that the registration of a per-mixin-class does not invoke - automatically the constructors of the registered class. - The method <@tt>instmixin overwrites any previous settings. + If <@tt>$args is one argument, it specifies a list of instmixins to + be set. Every instmixin must be a defined class. + If <@tt>$args has more argument, the first one specifies the + action. Possible values are <@tt>set, <@tt>get, + <@tt>add or <@tt>delete, it modifies the current + settings as indicated. For more details, check the tutorial. } - return "empty string" + return "if <@tt>$args empty return current instmixins, otherwise empty" } -@ Class instproc instmixinappend { - mixinList "name of the new instmixin" -} { - description { - Convenience method that appends an instmixin to the existing mixins of the class. - } - return "empty string" -} @ Class instproc instparametercmd { name "variable to be provided with getter/setter method" @@ -990,19 +1037,6 @@ return "empty string" } -@ Class instproc insttclcmd { - name "cmd to be execute in obj scope" -} { - description { - Create a method 'name' that is evaluated as a tcl command in the - scope of the object. E.g. 'Object insttclcmd vwait' creates - an instproc vwait on Object that executes Tcl's vwait in the - scope of the object. That is local vars of the object are accessible - to that vwait. (Used to circumvent, for instance, the TCL_GLOBAL_ONLY - flag of vwait in Tcl.) - } - return "empty string" -} @ Class instproc new { "?-childof obj? ?args?" "args passed to create"