Skip to content
Tcl Source Code History Of Ticket 818100ffff
Login

History Of Ticket 818100ffff

Artifacts Associated With Ticket 818100ffff

  1. Ticket change [1efbe8f4f5] (rid 91071) by nobody on 2003-10-05 13:13:16:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
      
    4. foundin initialized to: "obsolete: 8.5a0"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to: "false is not false in expr"
    11. type initialized to: "RFE"
  2. Ticket change [d75614f4b5] (rid 123965) by dkf on 2003-10-06 06:07:51:

    1. 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.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. resolution changed to: "Invalid"
    5. status changed to: "Closed"
    6. subsystem changed to: "47. Bytecode Compiler"
    7. username: "dkf"
  3. Ticket change [71734d3177] (rid 100677) by dkf on 2003-10-06 06:07:52:

    1. closedate changed to: "2003-10-05T23:07:52"
    2. closer changed to: "dkf"
  4. Ticket change [fc3f7166cc] (rid 108201) by mistachkin on 2003-10-06 06:32:13:

    1. status changed to: "Pending"
  5. Ticket change [7c9f15ee56] (rid 97115) by mistachkin on 2003-10-06 06:32:14:

    1. 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.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  6. Ticket change [b8639d07c6] (rid 128958) by dkf on 2003-10-06 20:25:38:

    1. status changed to: "Open"
  7. Ticket change [23dfa6fe51] (rid 131008) by dkf on 2003-10-06 20:25:41:

    1. foundin changed to: "None"
    2. resolution changed to: "None"
    3. subsystem changed to: "None"
  8. Ticket change [b4f6f32f91] (rid 125149) by dkf on 2003-10-06 20:25:42:

    1. assignee changed to: "nobody"
  9. Ticket change [612a147410] (rid 92200) by dkf on 2003-10-06 20:25:43:

    1. title changed to: "not all equal booleans are equivalent"
  10. Ticket change [60046726a7] (rid 115920) by dkf on 2003-10-06 20:25:44:

    1. 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.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  11. Ticket change [fda5b1b11f] (rid 108436) by dkf on 2003-10-06 20:30:20:

    1. subsystem changed to: "47. Bytecode Compiler"
  12. Ticket change [9db744fb0a] (rid 96361) by dgp on 2003-11-13 05:51:11:

    1. assignee changed to: "dkf"
  13. Ticket change [029ed43a10] (rid 119680) by dkf on 2003-11-13 07:08:10:

    1. assignee changed to: "nobody"
  14. Ticket change [66a2e58243] (rid 102747) by dkf on 2003-11-13 07:08:11:

    1. 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!]}
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  15. Ticket change [4b735c520e] (rid 126713) by dgp on 2003-11-13 07:21:45:

    1. assignee changed to: "dgp"
  16. Ticket change [0eb5ff47d0] (rid 94661) by dgp on 2004-12-10 00:53:06:

    1. assignee changed to: "nobody"
  17. Ticket change [ee97306ab8] (rid 104101) by dgp on 2005-11-02 00:17:44:

    1. status changed to: "Closed"
  18. Ticket change [fe39e5c88f] (rid 108544) by dgp on 2005-11-02 00:17:45:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2005-11-01T17:17:45"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      
      TIP 182 resolved this issue.
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Out of Date"
    8. username: "dgp"