home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- expanded class BOOLEAN
- --
- -- Note : corresponding C type is "int"
- --
- inherit
- BOOLEAN_REF
- redefine
- infix "and", infix "and then", infix "or",
- infix "or else", infix "implies", infix "xor",
- prefix "not", to_string, to_integer
- end;
-
- feature {ANY}
-
- infix "and" (other: BOOLEAN): BOOLEAN is
- -- `and' of Current with `other'.
- external "CSE"
- end;
-
- infix "and then" (other: BOOLEAN): BOOLEAN is
- -- Semi-strict `and' of Current with `other'.
- external "CSE"
- end;
-
- infix "implies"(other: BOOLEAN): BOOLEAN is
- -- Does Current imply `other'.
- external "CSE"
- end;
-
- infix "or" (other: BOOLEAN): BOOLEAN is
- -- `or' of Current with `other'
- external "CSE"
- end;
-
- infix "or else" (other: BOOLEAN): BOOLEAN is
- -- Semi-strict `or' of Current with `other'
- external "CSE"
- end;
-
- infix "xor" (other: BOOLEAN): BOOLEAN is
- -- `xor' of Current with `other'
- do
- if Current then
- Result := not other;
- else
- Result := other;
- end;
- end;
-
- prefix "not": BOOLEAN is
- -- `not' of Current.
- external "CSE"
- end;
-
- to_string: STRING is
- do
- if Current then
- Result := "true";
- else
- Result := "false";
- end;
- end;
-
- to_integer: INTEGER is
- do
- if Current then
- Result := 1;
- else
- Result := 0;
- end;
- end;
-
- end -- BOOLEAN
-