From: Rudolf Polzer Date: 2002-10-26T06:45:42+09:00 Subject: Re: How come true, false don't support <=> (comparison) operator? Scripsit ille Paul Brannan : > On Sat, Oct 26, 2002 at 03:18:12AM +0900, Marcin 'Qrczak' Kowalczyk wrote: > > I find 'false < true' in all languages I know. Do you know any where > > it's otherwise? > > It is true in languages that use 0 for false and 1 for true. Python, > Perl, C, and C++ fall into this category. There are probably countless > others. [...] I only know one counter-example: | Bywater BASIC Interpreter/Shell, version 2.20 patch level 2 | Copyright (c) 1993, Ted A. Campbell | Copyright (c) 1995-1997, Jon B. Volkoff | | bwBASIC: PRINT 1 = 0 | 0 | bwBASIC: PRINT 1 = 1 | -1 | bwBASIC: SYSTEM The same holds for QBasic and Omikron BASIC. In these false is defined as 0 (all bits are 0 bits) and true as -1 (since all bits are 1 bits). The reason is - IMHO - that NOT can only be used for logical negation if true == NOT false, and if one defines false as being 0, true must be -1. Since BASIC does neither distinguish between logical values and integers nor have different operators for these, so this hack has to be done. -- [mpg123d] Just playing: .../13 ruseau no mori - chagall no sora.mp3 Ritsuko: "You cooked this, didn't you Misato?" Misato: "Oh, can you tell?" Ritsuko: "Yes, by its taste."