[Prev][Next][Index][Thread]

zero? & 0 | 1



I like the idiomatic expression

bool-value? & 0 | 1

as a shorthand for if-then-else.

For filing a bug in an open-source Dylan implementation :-) I need
confirmation that the above expression evaluates to 0 for bool-value? == #t
and 1 for bool-value? == #f

The reasoning is that binary operators are evaluated from left to right and
&, | only evaluate their rhs if necessary.

Can somebody confirm this?
Any references?

Thanks,

	Gabor





Follow-Ups: