Subject | Re: [Firebird-Architect] ORs in Where statement |
---|---|
Author | David Garamond |
Post date | 2003-06-13T04:00:44Z |
Leyne, Sean wrote:
True OR (anything...)
will always still be True. This is not about determining final truth
value, but about side effects. I used to remember that they have an
option like this in Turbo Pascal (and perhaps still do in Delphi).
Sometimes when a programmer writes:
if (x=1) and (someFunc(x)=2) then begin
...
end
he expects someFunc() to _always_ be evaluated, no matter what the value
of x is. someFunc() might do stuffs that have side effects. In these
cases, complete boolean evaluation makes a difference.
--
dave
>>and can't come up with any scenario where subsequent OROf course
>>conditions could override a preceding True...
>
> I completely agree! Would suggest that this be dropped in the v2.0
> release.
True OR (anything...)
will always still be True. This is not about determining final truth
value, but about side effects. I used to remember that they have an
option like this in Turbo Pascal (and perhaps still do in Delphi).
Sometimes when a programmer writes:
if (x=1) and (someFunc(x)=2) then begin
...
end
he expects someFunc() to _always_ be evaluated, no matter what the value
of x is. someFunc() might do stuffs that have side effects. In these
cases, complete boolean evaluation makes a difference.
--
dave