Artifacts Associated With Ticket 1306288
Ticket change [28c9ae7551] (rid 88762) by rrh on 2005-09-27 21:56:35:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- 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?
- foundin initialized to: "obsolete: 8.4.11"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "rrh"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "Tcl_ParseExpr misdocumented and/or misnamed"
- type initialized to: "Bug"
Ticket change [80fccf8d7e] (rid 116959) by msofer on 2005-09-28 05:17:22:
- assignee changed to: "dgp"
Ticket change [50abe3241d] (rid 126013) by dgp on 2005-09-29 00:12:32:
- closedate changed to: "2005-09-28T17:12:32"
- closer changed to: "dgp"
- 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.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Closed"
- username: "dgp"