Skip to content
Tcl Source Code History Of Ticket 0439e1e1a3
Login

History Of Ticket 0439e1e1a3

Artifacts Associated With Ticket 0439e1e1a3

  1. Ticket change [2fa5bded1e] (rid 228438) by jan.nijtmans on 2024-07-05 09:03:41:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      Example:
      <pre>
      $ tclsh9.0
      % set x [lseq 1 11111111111111];set y 5
      5
      % expr {$x+$y}
      </pre>
      
      Doing this hangs a long time, because a string representation is generated for the lseq. But we know already that an lseq with 0 or  >1 entry can never be handled by '+'. Would be nice to detect that early, without taking that much time.
      
    5. foundin initialized to: "8.7/9.0"
    6. is_private initialized to: "0"
    7. login: "jan.nijtmans"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0c50e5320704d174412e57b873d8932de15303e0"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "jan.nijtmans"
    14. subsystem initialized to: "48. Number Handling"
    15. title initialized to: "Slow detection of illegal expr argument"
    16. type initialized to: "Bug"
  2. Ticket change [3ca4d20084] (rid 228445) by jan.nijtmans on 2024-07-05 10:01:10:

    1. assignee changed to: "jan.nijtmans"
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  3. Ticket change [437fb36327] (rid 228458) by jan.nijtmans on 2024-07-07 14:10:12:

    1. icomment:
      I think [2290847d23a494e4|this] is how it should be:
      
      If the obj being handled by "expr" can be represented as a list and has more than 1 element (so a dict as well), it now gives a slightly different error-message:
      
      <pre>
      % set x [lseq 1 11111111111111];set y 5
      5
      % expr {$x+$y}
      can't use a list as operand of "+"
      </pre>
      
      A side-effect of this is that Tcl_GetNumberFromObj() now tries to
      convert the object to a list, if it isn't already one of the
      other known types (like dict, lseq, or index). That's very useful in
      further error-handling, since the typePtr or lengthProc then
      can be inspected for this case without trying to do more parsing.
      
      It might also be very useful for the implementation of a future
      Tcl_GetValueFromObj() ....
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  4. Ticket change [36ede3212e] (rid 228459) by jan.nijtmans on 2024-07-07 14:10:38:

    1. icomment:
      I think [2290847d23a494e4|this] is how it should be:
      
      If the obj being handled by "expr" can be represented as a list and has more than 1 element (so a dict as well), it now gives a slightly different error-message:
      
      <pre>
      % set x [lseq 1 11111111111111];set y 5
      5
      % expr {$x+$y}
      can't use a list as operand of "+"
      </pre>
      
      A side-effect of this is that Tcl_GetNumberFromObj() now tries to
      convert the object to a list, if it isn't already one of the
      other known types (like dict, lseq, or index). That's very useful in
      further error-handling, since the typePtr or lengthProc then
      can be inspected for this case without trying to do more parsing.
      
      It might also be very useful for the implementation of a future
      Tcl_GetValueFromObj() ....
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [00d3f1202a] (rid 228571) by jan.nijtmans on 2024-07-08 20:27:32:

    1. icomment:
      Remark by Brian Griffin:
      <pre>
      The only change I would recommend is to not use a contraction in the error message. In other words, use “cannot” instead of “can’t”. IMO, messages should be formal, not conversational.
      
      -Brian
      </pre>
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [bc83c84951] (rid 228572) by jan.nijtmans on 2024-07-08 20:29:20:

    1. icomment:
      Christian Werner wrote:
      <pre>
      While I fully support elimination of single single quotes in error
      messages regardless of formalism or conversation I wonder how many
      omelettes we'll be able to make from the potentially many broken eggs.
      Alternatively, we could conserve these eggs for later.
      
      Best,
      Christian
      <pre>
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [cd5af38b9e] (rid 228577) by jan.nijtmans on 2024-07-09 09:32:08:

    1. icomment:
      While testing:
      <pre>
      $ tclsh9.0
      % set x [lseq 1 11111111111111];set y 5
      5
      % if {$x} {puts stdout abc}
      </pre>
      
      This also hangs, and could be handled the same way.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [1ec8413c9b] (rid 228591) by jan.nijtmans on 2024-07-09 13:38:38:

    1. icomment:
      More examples handled now (integers and doubles):
      <pre>
      $ tclsh9.0
      %  set x [lseq 1 11111111111111]
      5
      % binary encode base64 -maxlen $x data
      expected integer but got a list
      % binary format d $x
      expected floating-point number but got a list
      </pre>
      
      See: [5d333307578b6a00]
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [9721cfc297] (rid 233835) by dgp on 2024-09-26 17:01:10:

    1. icomment:
      
      Beware that TclMaxListLength() is not written to be accurate.
      It is written to be reasonably quick, and to produce an over-estimate
      of how many elements the list might have -- if it is a list at all.
      
      Calling something "a list" because TMLL() returns a value bigger than 1
      is not an accurate claim.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  10. Ticket change [686b6fc13b] (rid 233853) by jan.nijtmans on 2024-09-26 19:45:45:

    1. icomment:
      > Calling something "a list" because TMLL() returns a value bigger than 1
      is not an accurate claim.
      
      Indeed! There's still time until 9.0.1 to make it better. Current use was meant as a quick fix, in order to - at least - prevent conversion to a list.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  11. Ticket change [2c2f7d6d47] (rid 234063) by jan.nijtmans on 2024-10-08 22:40:56:

    1. closedate changed to: "2460592.4450961"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Should be [a618dcb27007fabd|better] now. Also (partly) backported to 8.7
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"