Hi,
According to the docs, the "is" operator is fourth level, the "and" is
second level, so the "and" must be computed before the "is". But it
seems fpc treats "is" and "and" as same level:
{$mode objfpc}
uses Classes;
var
b: boolean;
o: TObject;
begin
// this compiles, but should fail:
i
On Sat, 8 Dec 2018 20:38:23 +0100
Mattias Gaertner via fpc-pascal wrote:
>[...]
> According to the docs, the "is" operator is fourth level, the "and" is
> second level, so the "and" must be computed before the "is". But it
> seems fpc treats "is" and "and" as same level:
>[...]
Btw, there is a d
On Sat, 8 Dec 2018 20:38:23 +0100
Mattias Gaertner via fpc-pascal wrote:
> Hi,
>
> According to the docs, the "is" operator is fourth level, the "and" is
> second level, so the "and" must be computed before the "is".
Link:
https://www.freepascal.org/docs-html/ref/refch12.html
Mattias
Op 2018-12-08 om 20:38 schreef Mattias Gaertner via fpc-pascal:
According to the docs, the "is" operator is fourth level, the "and" is
second level, so the "and" must be computed before the "is". But it
seems fpc treats "is" and "and" as same level:
logical (boolean) vs bitwise AND difference?
On Sat, 8 Dec 2018 21:23:57 +0100
Marco van de Voort wrote:
> Op 2018-12-08 om 20:38 schreef Mattias Gaertner via fpc-pascal:
> > According to the docs, the "is" operator is fourth level, the "and"
> > is second level, so the "and" must be computed before the "is". But
> > it seems fpc treats "is
On Sat, 8 Dec 2018, Mattias Gaertner via fpc-pascal wrote:
On Sat, 8 Dec 2018 21:23:57 +0100
Marco van de Voort wrote:
Op 2018-12-08 om 20:38 schreef Mattias Gaertner via fpc-pascal:
> According to the docs, the "is" operator is fourth level, the "and"
> is second level, so the "and" must b
On Sat, 8 Dec 2018 22:03:11 +0100 (CET)
Michael Van Canneyt wrote:
>[...]
> In delphi, AS is second level, and 'is' is fourth level.
>
> http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Expressions_(Delphi)
>
> If FPC does this differently, then I think this is an incompatibility.
What has "a
var
b: boolean;
o: TObject;
begin
// this compiles, but should fail:
if o is TComponent and b then ;
It will compile if $BOOLEVAL is on the default (-) because the result
can be determined without considering precedence, see:
https://www.freepascal.org/docs-html/prog/progsu4.ht
On Sat, 8 Dec 2018, Mattias Gaertner via fpc-pascal wrote:
On Sat, 8 Dec 2018 22:03:11 +0100 (CET)
Michael Van Canneyt wrote:
[...]
In delphi, AS is second level, and 'is' is fourth level.
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Expressions_(Delphi)
If FPC does this differently,