Functions with 2+ arguments

Pim van Pelt pim at ipng.ch
Tue Oct 22 21:34:59 CEST 2024


Hoi folks,

Consider the following two functions in Bird v2.15.1:

function test_ok(int var1) -> bool
{
   if (bgp_large_community ~ [ (50869,1000,var1), (50869,2000,8298) ]) 
then return true;
   return false;
}

function test_nok(int var1; int var2) -> bool
{
   if (bgp_large_community ~ [ (50869,1000,var1), (50869,2000,var2*)* ]) 
then return true;
   return false;
}

The first one parses fine, but the second function yields a parse error on
bird: __filename__:199:66 Expression of type int expected

Position 199:66 is the closing parenthesis directly after var2. I 
colored that paren red above.
Is my construct or syntax incorrect in the test_nok() case?

groet,
Pim

-- 
Pim van Pelt
PBVP1-RIPE -https://ipng.ch/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20241022/e88e8557/attachment.htm>


More information about the Bird-users mailing list