Index: xotcl/tests/forwardtest.xotcl =================================================================== diff -u -r2846921e448d4d4aeb3245ebbfe4381182f0e286 -r1aa7246cc8e44078c9dbd33e03992478615f314f --- xotcl/tests/forwardtest.xotcl (.../forwardtest.xotcl) (revision 2846921e448d4d4aeb3245ebbfe4381182f0e286) +++ xotcl/tests/forwardtest.xotcl (.../forwardtest.xotcl) (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) @@ -1,4 +1,4 @@ -# $Id: forwardtest.xotcl,v 1.7 2006/09/25 08:29:04 neumann Exp $ +# $Id: forwardtest.xotcl,v 1.8 2006/09/27 08:12:40 neumann Exp $ package require XOTcl namespace import -force xotcl::* package require xotcl::test @@ -195,7 +195,26 @@ ? {obj @list} [list x 1 y 2 z] ? {obj @list a b c} [list x 1 y 2 z a b c] +############################################### +# substitution depending on number of arguments +############################################### +obj forward f %self [list %argclindex [list a b c]] +obj proc a args {return [list [self proc] $args]} +obj proc b args {return [list [self proc] $args]} +obj proc c args {return [list [self proc] $args]} +? {obj f} [list a {}] +? {obj f 1 } [list b 1] +? {obj f 1 2} [list c {1 2}] +? {catch {obj f 1 2 3}} 1 + +############################################### +# option earlybinding +############################################### +obj forward s -earlybinding ::set %proc +? {obj s 100} 100 +? {obj s} 100 + Object instproc f args { next } Class NS