Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Warum sind Klassenoperatoren nicht bissl intelligenter? (https://www.delphipraxis.net/203663-warum-sind-klassenoperatoren-nicht-bissl-intelligenter.html)

himitsu 10. Mär 2020 11:23

AW: Warum sind Klassenoperatoren nicht bissl intelligenter?
 
Klar kann man sowas machen, aber "logisch" ist es dann nicht, warum

Delphi-Quellcode:
if a = b then
nicht das gleiche Ergebnis liefert, wie
Delphi-Quellcode:
if not (a <> b) then
.


Außer du fängst da mit einer Tristate-Logic oder mehr an
ungleich, fast gleich, gleich, gleicher, ganz gleich, identisch

OK, kennt man z.B. aus PHP
PHP-Quellcode:
if (0 == '0') // true

PHP-Quellcode:
if (0 == false) // true

und nicht
PHP-Quellcode:
if (0 === '0') // false

PHP-Quellcode:
if (0 === false) // false

aber auch da verhalten sich == und != gleich.


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:57 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz