Re: Eu Rebellion (was: New Euphoria Users Website)
- Posted by Rom <kjehas at frisurf.no> Nov 16, 2002
- 495 views
From: "Kat" <kat at kogeijin.com> > > true/false/unknown as boolean type instead of True/False ..... > > Not true, Turbo Pascal has "bytebool", which was a byte to signify the > boolean condition. You can set the level of validity of the truth, and a test > of > the truth was positive for any value over 0. This may be easy in Eu > programming too. (Delphi helpfile about ByteBool) A Boolean variable can assume the ordinal values 0 and 1 only, but variables of type ByteBool, WordBool, and LongBool can assume other ordinal values. An expression of type ByteBool, WordBool, or LongBool is considered False when its ordinal value is zero, and True when its ordinal value is nonzero. Whenever a ByteBool, WordBool, or LongBool value is used in a context where a Boolean value is expected, the compiler will automatically generate code that converts any nonzero value to the value True. This code works bad in any language: Boolean A if not A then ...(...action for that case) The line should not have fired because A is uninstantiated (=unknown). We haven't said yet that A is False (actual it does not fire in Delphi ... contrary to above documentation). The logic should have been: if A then ... else if not A then ... else .....(meaning A is nil) The True/False dictomy is used in all logical operators (and, or...). When implementing T/F/nil logic here (in operators like and/or too) programming code will change much. The meaning of A and B vs A and B (with nil states allowed) is quite different. The output from (A and B) in C++ or Delphi or Euphoria today is such that is makes it unsuitable for stating anything people normally regard as a rule. You have to know exactly how a computer program works and then make custom programming. But I was wrong in not making it clear that this is not only a question of a type (custom types may be defined freely in C++/Delphi), but also a question of control logic (which is also based on True/False). Rom