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
Op 2018-12-08 om 22:03 schreef Michael Van Canneyt:
I don't see where the bitwise should be involved here. There is no
integer.
The docs do not mention a different precedence lvl for logical/bitwise
"and".
My line of thought was the docs might mean bitwise there.
Because to the best of my
On Sun, 9 Dec 2018, Marco van de Voort wrote:
Because to the best of my knowledge, here isn't any difference in
precedence, so there is nothing to explain.
And that was what my post was, checking that.
I'm more of the "more parenthesis never hurt anybody" school, so
operator precedence b
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,
11 matches
Mail list logo