[SR-Users] Lazy evaluation in if expressions?

Daniel-Constantin Mierla miconda at gmail.com
Tue Sep 20 10:06:08 CEST 2011



On 9/16/11 3:40 PM, Klaus Darilion wrote:
> IIRC (there was a similar thread years ago): yes
this is true indeed -- just wanted to add that the other logical 
operators don't evaluate right side of the expression if the overall 
result is known from the left side, for example, if left side is true in 
an OR expression, the right side is not evaluated anymore.

Cheers,
Daniel

>
> On 16.09.2011 13:20, Morten Isaksen wrote:
>> Does Kamailio use lazy evaluation in if expressions?
>>
>> Like
>>
>> if ($var(a) == 2&&  $var(b) ==3) { ... }
>>
>> then $var(b) == 3 is only evaluated if $var(a) == 2 is true
>>

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda




More information about the sr-users mailing list