Index: TODO =================================================================== diff -u -N -ra35803ea84148ebadd79d8527830dcbdebd8873e -re87eb2ded5035dc51ba89af4f68a0925db664024 --- TODO (.../TODO) (revision a35803ea84148ebadd79d8527830dcbdebd8873e) +++ TODO (.../TODO) (revision e87eb2ded5035dc51ba89af4f68a0925db664024) @@ -4996,6 +4996,10 @@ ======================================================================== TODO: +- Is -onerror for forwarders really needed?! Can we pull it out from + NX, at least? I can't see what -onerror should achieve that cannot + be done using catch. + - Revisit nsf::*::assertion interface? Why does nsf::method::assertion allow for setting invariants. One would rather expect a ::nsf::object|class::assertion or the like? Index: doc/forward.man.inc =================================================================== diff -u -N -re0b2cf92c8e886f0a51e9d5233e636251edc45e7 -re87eb2ded5035dc51ba89af4f68a0925db664024 --- doc/forward.man.inc (.../forward.man.inc) (revision e0b2cf92c8e886f0a51e9d5233e636251edc45e7) +++ doc/forward.man.inc (.../forward.man.inc) (revision e87eb2ded5035dc51ba89af4f68a0925db664024) @@ -3,7 +3,7 @@ [keywords "value checker"] [keywords "forward method"] -[call [arg [vset CMD]] [opt "public | protected | private"] [const [vset SCOPE]] [method forward] [arg methodName] [opt [option "-default [arg value]"]] [opt [option "-methodprefix [arg prefixName]"]] [opt [option "-objframe"]] [opt [option "-onerror [arg cmdName]"]] [opt [option "-returns [arg valueChecker]"]] [opt [option "-verbose"]] [arg arg] [opt "[arg arg] ..."]] +[call [arg [vset CMD]] [opt "public | protected | private"] [const [vset SCOPE]] [method forward] [arg methodName] [opt [option "-default [arg value]"]] [opt [option "-methodprefix [arg prefixName]"]] [opt [option "-frame object"]] [opt [option "-onerror [arg cmdName]"]] [opt [option "-returns [arg valueChecker]"]] [opt [option "-verbose"]] [arg arg] [opt "[arg arg] ..."]] Define a [term "forward method"] for the given [vset SCOPE]. The definition of a [term "forward method"] registers a predefined, but @@ -20,7 +20,7 @@ As for a regular [method "[vset SCOPE] method"], [option "-returns"] allows for setting a [term "value checker"] on the values returned by the -resulting Tcl command call. When setting the [term "switch"] [option "-objframe"], the +resulting Tcl command call. When passing [const object] to [option "-frame"], the resulting Tcl command is evaluated in the context of the object receiving the [term "forward method"] call. [option "-onerror"] sets a Tcl command [arg cmdName] which is called as the handler for errors @@ -37,7 +37,7 @@ [list_begin itemized] -[item] [const %proc] becomes substituted for the name of the [term "forward method"], i.e. [arg methodName]. +[item] [const %method] becomes substituted for the name of the [term "forward method"], i.e. [arg methodName]. [item] [const %self] becomes substituted for the name of the object receiving the call of the [term "forward method"]. @@ -54,7 +54,7 @@ used in ascending order. [para] Note that [arg value] can be a literal or any of the placeholders -(e.g., [const %proc], [const %self]). An exception are position +(e.g., [const %method], [const %self]). An exception are position prefixes themselves which are evaluated according to the [const %][arg cmdName]-rule (see below). Index: tests/forward.test =================================================================== diff -u -N -r22dbca7a5267c4db0ee4c641047983b84387162f -re87eb2ded5035dc51ba89af4f68a0925db664024 --- tests/forward.test (.../forward.test) (revision 22dbca7a5267c4db0ee4c641047983b84387162f) +++ tests/forward.test (.../forward.test) (revision e87eb2ded5035dc51ba89af4f68a0925db664024) @@ -294,7 +294,7 @@ nx::Object create obj obj public object forward foo list {%@end %self} ? {obj foo 1 2 3} [list 1 2 3 ::obj] - obj public object forward foo list {%@end %proc} + obj public object forward foo list {%@end %method} ? {obj foo 1 2 3} [list 1 2 3 foo] obj public object forward foo list {%@end %%}