Artifacts Associated With Ticket 1187123fffffffffffffffffffffffffffffffff
Ticket change [489aac15d9] (rid 99919) by dgp on 2005-04-21 05:38:05:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% set x 5 5 % string is boolean $x 0 % namespace ensemble create -prefixes $x :: % string is boolean $x 1 % set x 5 So $x is/is not a valid boolean depending on its Tcl_ObjType. Foundation of the bug is that Tcl_GetBoolean and Tcl_GetBooleanFromObj are inconsistent in the sets of strings they accept as valid boolean values.
- foundin initialized to: "obsolete: 8.5a3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "10. Objects"
- title initialized to: "booleans break EIAS"
- type initialized to: "Bug"
Ticket change [c7b6c0001f] (rid 121986) by dgp on 2005-04-21 13:09:59:
- icomment:
Logged In: YES user_id=80530 Also lurking here is the inconsistency in the set of values that pass string is boolean -strict $x and the set of values that do not raise an error in: expr {$x && $x} Consider $x having value "5" or "0xface" or "3.14159". All rejected by [string is boolean] (unless shimmering confuses) but all accepted by [expr] as operands to its boolean operators. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d48b2a9aed] (rid 123465) by msofer on 2005-04-21 19:01:27:
- icomment:
Logged In: YES user_id=148712 Re the second comment: that is ok according to the docs. The boolean operators take as arguments booleans *or* numbers, and produce an integer 0/1 result - according to both the [expr] man page and TEBC. [string is boolean] OTOH is supposed to only recognise the forms 0/1, yes/no, on/off and true/false according to the [string] and Tcl_GetBoolean manuals. In other words, [string is boolean $x] is not supposed to coincide with [expr ![catch {expr $x && $x}]] - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [656ff056c3] (rid 102548) by msofer on 2005-04-21 19:14:51:
- icomment:
Logged In: YES user_id=148712 The function that does not agree with the docs is Tcl_GetBooleanFromObj: what the code does is return the value of [expr !!$x] (or an error). What the docs say it does is identical to Tcl_GetBoolean. The part that is wrong is branded as /* * Use the obvious shortcuts for numerical values; if objPtr is not * of numerical type, parse its string rep. */ Obvious maybe ... but wrong. This provides a "Tcl_GetTruthValueFromObj" or something like that. - login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [e4c8272e2c] (rid 88019) by dgp on 2005-04-22 03:24:11:
- assignee changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 committing fix to HEAD. Backport will require some more effort.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [9ca457713b] (rid 96180) by dgp on 2005-04-22 22:54:18:
- icomment:
Logged In: YES user_id=80530 corrected fix committed to HEAD. still needs backport.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [1858ca207e] (rid 122644) by dgp on 2005-04-22 23:31:03:
- closedate changed to: "2005-04-22T16:31:03"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 More cautious fix committed for 8.4.10.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"