|
|
To allow subroutines to evolve over time without having to change all of the existing calls, Vera supports optional arguments. Optional arguments must have default values. To allow subroutines to evolve over time without having to change all of the existing calls, OpenVera supports optional arguments. Optional arguments must have default values. |
|
|
1 program optional_value {
2 print(1);
3 print(1,2);
4 print(1,2,3);
5 }
6
7 task print (integer m, ((integer n = 100)), (integer o = 10)) {
8 printf("Inside m %0d\n",m);
9 printf("Inside n %0d\n",n);
10 printf("Inside o %0d\n",o);
11 }
You could download file optional_value.vr here
|