cfengine/core — pull request #452 by tzz (2013-03-20 03:45:55+00:00)
Title: ifelse() function

Proposed example usage (note that any odd number of arguments are allowed, similar to the Oracle DECODE() function for instance):

```
body common control
{
bundlesequence => { run };
}

bundle agent run
{
vars:
"a" string => concat(
# ifelse(), # fatal error
# ifelse("x", "y"), # fatal error
ifelse("any", "1", "0"),
ifelse(3),
ifelse("!any", 2, 3),
ifelse("undefined.any", 5, "missing||!cfengine", 6, 7)
);

reports:
"a = $(a)";
}
```

Output:

```
R: a = 1337
```

If this is OK syntax-wise I will write acceptance tests.