Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-02

Some questions regarding language changes in trunk

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

leledumbo

http://wiki.freepascal.org/User_Changes_Trunk#Comparative_operators_can_have_any_result_type

Is this a preparation for LINQ-like functionality?

With false and true being integer, how could it be used in an boolean-expression-expected context? e.g. if, while and until condition? Anyway, AFAIK classically Boolean is declared as enum:

type Boolean = (False,True);
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Some-questions-regarding-language-changes-in-trunk-tp5718272.html Sent from the Free Pascal - General mailing list .

Reply by email

Sven Barth
to leledumbo
leledumbo wrote

Delphi compatibility. But as the example shows you could use it for LINQ-like functionality as well.

Show quoted text 8 lines
> http://wiki.freepascal.org/User_Changes_Trunk#True_and_False_are_not_keywords_anymore With false and true being integer, how could it be used in an boolean-expression-expected context? e.g. if, while and until condition? Anyway, AFAIK classically Boolean is declared as enum: type Boolean = (False,True);

Delphi compatibility (or as is written for that entry: compatibility to other Pascal compilers in general). This won't have any negative impact on logical expressions. Also keep in mind that comparisons with "= True" could lead to wrong results anyway as "True" for Boolean and friends is "1" while "True" for ByteBool and friends is any non-zero value.

Regards,
Sven

Reply by email

Sven Barth
to leledumbo
leledumbo wrote
> This won't have any negative impact on logical expressions I expect that. I suppose the compiler has a mechanism for this such that "if true then" would work.

I haven't explicitely checked it nor looked at the code (no time currently), but it should either be covered by the usual type conversion system or indeed special code. If not that should be considered a bug and reported as such. ;)

Regards,
Sven

Reply by email