Number of arguments to a function

fredrik danerklint fredan-bird at fredan.se
Sun Sep 25 19:56:01 CEST 2011


I've got an function with more than two arguments.

You can define a function with more than two, but you can not call that 
function, with two or more arguments.

Tested with the source code from git in the last hour.

diff --git a/filter/test.conf b/filter/test.conf
index 4f09637..ef433eb 100644
--- a/filter/test.conf
+++ b/filter/test.conf
@@ -29,7 +29,7 @@ function mkpath(int a; int b)
        return [= a b 3 2 1 =];
 }
 
-function callme(int arg1; int arg2)
+function callme(int arg1; int arg2; int arg3)
 int local1;
 int local2;
 int i;
@@ -318,6 +318,8 @@ string s;
        callme ( 4, 4 );
        callme ( 7, 2 );
 
+       callme ( 7, 2 , 1);
+
        i = fifteen();
        print "Testing function calls: 15 = ", i;

The errormessage from bird: 
bird: test.conf, line 321: Wrong number of arguments for function callme.

-- 
//fredan



More information about the Bird-users mailing list