On 03/08/2020 15.43, Ranier Vilela wrote:
> Em seg., 3 de ago. de 2020 às 04:02, Sjoerd Mullender
> <sjoerd@monetdb.org <mailto:sjoerd@monetdb.org>> escreveu:
>
> Either way is correct.
>
> Are we missing something?
>
> The first form evaluates both (b->ttype != TYPE_void) and b->tkey, both
> of which result in either 0 or 1. The single & does a bit-wise AND on
> those two values and results in 1 if both sides evaluated to 1.
>
> In the second form, if first part evaluates to 0, b->tkey is not
> evaluated,
Sorry, see:
"
In the second form, if first part evaluates to 0, b->tkey is not evaluated,"
No matter the outcome of the first part, b-> key will always be evaluated.
and if the first part evaluates to 1, the second part is also
> evaluated. The restult, again, is only 1 if both sides evaluate to 1.
>
> Wait, bitwse AND (&) is not shortcut, If first part evaluates to 0
> *b->key is stiil evaluated.*
That's correct. I think I mentioned that.
Sorry, but I think it contradicts your first email, you say "not evaluated".
regards,
Ranier Vilela