Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 36ede3212e97e6d8b4733862e26d95faebdc66a2ae76e5d6debe349c87f48a9d
Ticket: 0439e1e1a37ff9c634280bc2490981f3e3c7e985
Slow detection of illegal expr argument
User & Date: jan.nijtmans on 2024-07-07 14:10:38
Changes

  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"