Skip to content
Tcl Source Code History Of Ticket 1306288
Login

History Of Ticket 1306288

Artifacts Associated With Ticket 1306288

  1. Ticket change [28c9ae7551] (rid 88762) by rrh on 2005-09-27 21:56:35:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The function Tcl_ParseExpr does more than do lexical
      and syntactic (parsing) analysis.  It also does some
      semantic analysis, to provide meaning to some lexemes,
      which leads to it detecting faults in plausibly well
      formed expressions.
      
      Thus, parsing 1+0x100000000000000000 (say) will fail,
      since semantic analysis determines that the underlying
      value this represents is bigger than an underlying
      "int" data type.
      
      The man page is silent on this matter, unless you count
      the phrase "...parses Tcl expressions...", and consider
      a Tcl expression to be malformed  if the literal
      numbers don't fit in an "int".
      
      This behaviour of Tcl_ParseExpr makes it
      difficult/impossible to use Tcl_ParseExpr to crack open
      expressions that use the domain of multi-precision
      arithmetic.  Perhaps Tcl 8.5a?,with the introduction of
      mp artithmetic, will clear up some of this?
      
    4. foundin initialized to: "obsolete: 8.4.11"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "rrh"
    9. subsystem initialized to: "45. Parsing and Eval"
    10. title initialized to: "Tcl_ParseExpr misdocumented and/or misnamed"
    11. type initialized to: "Bug"
  2. Ticket change [80fccf8d7e] (rid 116959) by msofer on 2005-09-28 05:17:22:

    1. assignee changed to: "dgp"
  3. Ticket change [50abe3241d] (rid 126013) by dgp on 2005-09-29 00:12:32:

    1. closedate changed to: "2005-09-28T17:12:32"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      
       "These are not the droids you are looking for"
      
      Tcl_ParseExpr() is meant to parse a string
      as a Tcl expression.  If/when Tcl's expression
      support changes, so does Tcl_ParseExpr(),
      so you'll see that the ** operator for exponentiation
      is parsed in Tcl 8.5 but not in earlier Tcl releases.
      Likewise, as you suggest, if/when Tcl expressions
      support operating on unlimited range integers
      (pending for Tcl 8.5 -- TIP 237) the expression
      parser will accept them as
      syntactically valid Tcl expressions.
      
      Tcl_ParseExpr() isn't meant to be any kind
      of general parsing engine for general expressions.
      
      Whether that's misdocumentation of misnaming,
      or just a strong assumption that within Tcl we
      assume a context of Tcl is a matter of opinion
      I suppose.
      
      And I do see your point about the implementation
      not providing a 100% "clean" separation between
      lexical matters and semantic matters.  That will
      continue to be true in the forseeable future.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Wont Fix"
    7. status changed to: "Closed"
    8. username: "dgp"