Artifacts Associated With Ticket 818100ffffffffff
Ticket change [1efbe8f4f5] (rid 91071) by nobody on 2003-10-05 13:13:16:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% expr {(0 == false) ? [puts true] : [puts "you're screwed"]} you're screwed miguelGeorge: let me check for an explanation, 5' miguelYep, seems to be a bug: the code of INST_EQ does not attempt a boolean conversion, it compares as numbers or strings only. - foundin initialized to: "obsolete: 8.5a0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "false is not false in expr"
- type initialized to: "RFE"
Ticket change [d75614f4b5] (rid 123965) by dkf on 2003-10-06 06:07:51:
- icomment:
Logged In: YES user_id=79902 It's not clear to me whether 0 and false should be equal in the context of the == operator. Indeed, == is defined (as are many other [expr] operators) to operate on preferentially numbers, and otherwise strings. In terms of that, "false" is not numeric, and "0" is a clearly different string. IMO it's not a bug. Just a misreading of the manual by the person submitting.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- subsystem changed to: "47. Bytecode Compiler"
- username: "dkf"
- icomment:
Ticket change [71734d3177] (rid 100677) by dkf on 2003-10-06 06:07:52:
- closedate changed to: "2003-10-05T23:07:52"
- closer changed to: "dkf"
Ticket change [fc3f7166cc] (rid 108201) by mistachkin on 2003-10-06 06:32:13:
- status changed to: "Pending"
Ticket change [7c9f15ee56] (rid 97115) by mistachkin on 2003-10-06 06:32:14:
- icomment:
Logged In: YES user_id=113501 In my opinion, we need a TIP to add a math func "bool()" which attempts to perform boolean conversion on it's argument. bool(true) == 1 bool(false) == 0 bool(yes) == 1 bool(no) == 0 bool(<any-non-zero-value>) == 1 bool(<any-zero-value>) == 0 This would make expr more complete.
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [b8639d07c6] (rid 128958) by dkf on 2003-10-06 20:25:38:
- status changed to: "Open"
Ticket change [23dfa6fe51] (rid 131008) by dkf on 2003-10-06 20:25:41:
- foundin changed to: "None"
- resolution changed to: "None"
- subsystem changed to: "None"
Ticket change [b4f6f32f91] (rid 125149) by dkf on 2003-10-06 20:25:42:
- assignee changed to: "nobody"
Ticket change [612a147410] (rid 92200) by dkf on 2003-10-06 20:25:43:
- title changed to: "not all equal booleans are equivalent"
Ticket change [60046726a7] (rid 115920) by dkf on 2003-10-06 20:25:44:
- icomment:
Logged In: YES user_id=79902 If you (or anyone else) want to write the TIP, feel free. I'd be tempted to make anything not recognized by Tcl_GetBooleanFromObj() an error when fed to bool(), just as int("some string") is illegal too. - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [fda5b1b11f] (rid 108436) by dkf on 2003-10-06 20:30:20:
- subsystem changed to: "47. Bytecode Compiler"
Ticket change [9db744fb0a] (rid 96361) by dgp on 2003-11-13 05:51:11:
- assignee changed to: "dkf"
Ticket change [029ed43a10] (rid 119680) by dkf on 2003-11-13 07:08:10:
- assignee changed to: "nobody"
Ticket change [66a2e58243] (rid 102747) by dkf on 2003-11-13 07:08:11:
- icomment:
Logged In: YES user_id=79902 I'm not going to do anything about this on my own; the current behaviour is exactly as documented and not a bug. It's up to someone else as far as I'm concerned. A workaround is to use !!, like this: expr {(!!0 == !!false) ? [puts Cool!] : [puts D'oh!]} - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [4b735c520e] (rid 126713) by dgp on 2003-11-13 07:21:45:
- assignee changed to: "dgp"
Ticket change [0eb5ff47d0] (rid 94661) by dgp on 2004-12-10 00:53:06:
- assignee changed to: "nobody"
Ticket change [ee97306ab8] (rid 104101) by dgp on 2005-11-02 00:17:44:
- status changed to: "Closed"
Ticket change [fe39e5c88f] (rid 108544) by dgp on 2005-11-02 00:17:45:
- assignee changed to: "dgp"
- closedate changed to: "2005-11-01T17:17:45"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 TIP 182 resolved this issue.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Out of Date"
- username: "dgp"