Subject Re: [firebird-support] Is this a bug of Firebird?
Author Marsupilami79
Hmm - Delphi and Free Pascal do exactly that - they emit a warning, that the first assigned value never gets used.

Am 09.02.2017 um 10:30 schrieb Tim Ward tdw@... [firebird-support]:

It' the equivalent in a conventional programming language of saying:

x = a;
x = b;

where the compiler is expected to know that neither a not the first assignment have any side effects other than the assignment (and where the expression b doesn't depend on the value of x)(and where x isn't volatile, ect ect).

A compiler *could* detect and warn about such things (ie it's not forbidden by the laws of mathematics) but I don't think I know of any that do. And as there are good reasons for deliberately wanting to do the above it could only be a warning, not an error.

On 08/02/2017 23:36, 'Walter R. Ojeda Valiente' sistemas2000profesional@... [firebird-support] wrote:
The error is of the programmer, I agree with you, but to repeat the name of a variable without the Firebird showing any message of error is, at least for me, a bug.

To have 2 or more variables with the same name after the INTO clause is useless. The compiler can be smart enough to detect such thing.

Or not?



On Wed, Feb 8, 2017 at 2:36 PM, 'Leyne, Sean' Sean@... [firebird-support] <> wrote:

> Yes, but I can not know the value of the column X.ALU_NOMBRE
> And the idea, of course, is know that value, that's why it appears in the FOR
> SELECT. If not, I can do nothing with X.ALU_NOMBRE

You are asking for the system to evaluate the *intent* of logic.

That is completely outside the purview of any application environment that I know.

The only thing that a system can check/enforce is the correctness of the code, not to check whether the developer has 2 brain cells.


Tim Ward