Bogdan Pintea wrote:
> Miklos Tirpak wrote:
>> We just had a long discussion with Jan and Michal, and the result is that:
>>
>> - if (@rr.param.lr) will return false if the parameter exists, but has
>> empty body. So there will be no change, perl and pyton work the same way.
>>
> This would be fine and in accord with how the AVPs work now.
>> - a new function will be introduced that can be used to explicitly check
>> the existence of a header or parameter, something like if
>> (exists((@rr.param.lr)) than...
>>
>>
> Maybe a @rr.param.lr.exits or @rr.param.present.lr; I'd find something
> like this more natural than a "function".
This would be difficult to implement because it would probably require
major changes to the select parser, we would need to check for the
special word after or before every select component (the part
delimited by .).
Originally it used to work this way, only without "exists", i.e.
if (@rr.param.lr)
would do the same as if (@rr.param.lr.exists), that means the
expression would evaluate to true if the parameter exists, regardless
of the parameter's body.
I was thinking about it yesterday and came to the conclusion that this
is probably counter-intuitive -- or at least different from what other
programming languages, like perl and python, do.
There the expression evaluates to true if and only if the variable
(select in our case) has non empty body.
In any case the only use-case for the function is the lr parameter, so
it is not like it would significantly complicated the configuration
file. Parameters without body does not appear to be very common.
Jan.
_______________________________________________
Serdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/serdev