Tan Swee Heng wrote:
> Looking at app.c:
>
> // if expensive(i, 0) and expensive(i, 1): # <<<<<<<<<<<<<<
> if (__pyx_f_3app_expensive(__pyx_v_i, 0)) {
> __pyx_t_2 = __pyx_f_3app_expensive(__pyx_v_i, 1);
> } else {
> __pyx_t_2 = __pyx_f_3app_expensive(__pyx_v_i, 0);
> }
> Q: For the short-circuit, would the right behaviour be to store the
> result of the first evaluation in a temporary variable instead?
I'd say so. Pyrex generates this:
__pyx_5 = __pyx_f_3app_expensive(__pyx_v_i,0);
if (__pyx_5) {
__pyx_5 = __pyx_f_3app_expensive(__pyx_v_i,1);
}
--
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev