-----Original Message-----
>From: Bertrand Meltz <[log in to unmask]>
>Date: Tuesday, 31 January 2006 2:16
>As I said, a compiler developper once told me he was the one who
>implemented the WHERE, and he did it that way. He also told me that most
>compilers did the same.
>Personnally, I do not object, provided this divide by zero
>does not generate an error, in which case you could not even tell
>that it did this way. And you cannot qualify it as a bug :
It's easy to insist that it be done that way for the trivial cases cited.
However, the code must NOT be executed for the
particular exception(s) specified by WHERE.
A more elaborate expression might well include
function references, and in those function(s)
certain values of argument (specified in WHERE)
may be illegal, and if executed would bring downfall
of the run. Where does it end? The functions might
attempt to evaluate log with an argument <= 0, or
a subscript might be out of range, etc, etc.
The specific cases, e.g., WHERE(A>0) C = B/A
were merely to illustrate what WHERE is supposed to do.
> the
>standard barely even mentions the term compiler, AFAIK, and what
>it does behind your back is its business, provided it produces
>some standard conforming code, with no side effect.
>robin wrote:
>>From: Bertrand Meltz <[log in to unmask]>
>>Date: Friday, 27 January 2006 23:10
>>I am facing a difficulty with the relationships between the standard
>>and a compiler. I know that the standard does not deal with compilers,
>>but compiler makers do have to deal with the standard.
>
>>My gneral question is :
>>- Is a compound instruction where an īllegal operation is present, but
>> actually masked, legal itself? I´ll explain this contorted sentence
>> with an example :
>
>> where ( a > 0. ) b = SQRT( a)
>
>> Compilers generally compute all the SQRT( a), then perform the
>> assignment only where it should.
>
> No, they shouldn't be doing that at all.
> The purpose of the WHERE is that the operation [SQRT] is performed
> only in those cases where a is > 0.
>
> Consider also :
> where (a /= 0) b = c/a
> For the same reason as above, division is omitted
> in cases where a=0.
|