View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] non-positional arguments and init proc

From: Shishir Ramam <sramam_at_gmail.com>
Date: Tue, 7 Nov 2006 19:36:32 -0800

I must be missing something here - but are non-positional arguments not
permitted on the init proc?
A transcript of my attempts below...

thanks in advance for any help.
-shishir

% Class foo -parameter {{-a "apple"}}
::foo
% foo instproc init {{-a "apple"} args} {}
% foo f
::f
% foo f -a "banana"
::f: unable to dispatch method 'a' during '::f a'
% foo f a "banana"
::f
% foo instproc init {{-a "apple"} args} { puts "a=$a args=$args" }
% foo f a "banana"
a=apple args=a banana
::f
% foo f -a "banana"
::f: unable to dispatch method 'a' during '::f a'
% foo instproc init {{a "apple"} args} { puts "a=$a args=$args" }
% foo f a "banana"
a=a args=banana
::f
%

-- 
The point of living and of being an optimist, is to be
foolish enough to believe the best is yet to come.
  - Peter Ustinov