BOO-996, BOO-995: Added "then" keyword to replace "else" semantic in looping construc...
[boo.git] / tests / testcases / ducky / method-dispatch-11.boo
blobceea93fd0b1debbce2c88c407a7e4f856636cb75
1 """
2 func1
3 func2 with arg: test
4 func3 param:multiple
5 func3 param:params
6 func1
7 func2 with arg: dispatcher arg test
8 func3 param:dispatcher
9 func3 param:multiple
10 func3 param:args
11 func4 with arg: the arg
12 func4 param:42
13 """
14 def func1():
15 print 'func1'
17 def func2(arg1):
18 print 'func2 with arg: ' + arg1
20 def func3(*args):
21 for item in args:
22 print 'func3 param:' + item
24 def func4(arg1, *rest):
25 print 'func4 with arg: ' + arg1
26 for item in rest:
27 print 'func4 param:' + item
29 func1()
30 func2('test')
31 func3('multiple', 'params')
33 dispatcher = {'f1': func1, 'f2': func2, 'f3': func3, 'f4': func4 }
35 dispatcher['f1']()
36 dispatcher['f2']('dispatcher arg test')
37 dispatcher['f3']('dispatcher', 'multiple', 'args')
38 dispatcher['f4']('the arg', 42)