Artifacts Associated With Ticket 1771726fffffffffffffffffffffffffffffffff
Ticket change [6b481e0f49] (rid 128298) by deusued on 2007-08-10 14:58:12:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
As a loyal and devout Tcl professional (7+ years), I have come across a situation where I would really -love- to be able to force a variable type, or cast it, as a single type. While this may incur overhead, I would like to believe that it could be implemented in such a manner that both execution speed would be significantly faster (no casting required if a specific bit is set on the variable) and potentially reducing the memory overhead necessary to cast (I'm out of water here, though). ex: %set -double myDouble 1.002 %lappend myDouble 2 /error thrown, much like passing an array in as the first arg/ %set -string myString "1.01" %expr $myString + 2.01 /error thrown, much like passing {} in/ - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "deusued"
- subsystem initialized to: "07. Variables"
- title initialized to: "Forced Variable Types"
- type initialized to: "RFE"
Ticket change [4ec35a666a] (rid 125699) by dgp on 2007-08-11 02:22:33:
- assignee changed to: "dgp"
- closedate changed to: "2007-08-10T19:22:33"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Originator: NO To restrict the set of values a variable may hold, use variable write traces.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dgp"
Ticket change [67c9424e4c] (rid 102950) by deusued on 2007-08-11 02:34:47:
- icomment:
Logged In: YES user_id=741274 Originator: YES I must not have conveyed my interest well. I need -not- to restrict what variable types a variable may contain -- I know exactly what type I am using. I am looking for a significant reduction in memory usage as well as speed reduction (by forcing casting) *without* increasing cost (by way of time). I am -not- going to be tracing them. I am talking about a problem of scale, not a problem of usability.
- login: "deusued"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "deusued"
- icomment:
Ticket change [849b4edf61] (rid 117581) by dgp on 2007-08-11 02:44:31:
- assignee changed to: "msofer"
- icomment:
Logged In: YES user_id=80530 Originator: NO Are you suggesting a change so radical that a Tcl variable would be able to hold a value that was not a Tcl_Obj ? (Trying to make sense of phrases like "forcing casting" in this context. Tcl does not do "casting". Its model is to treat values as strings). If scaling issues are the real problem, has miguel's recent work on Var Reform (Tcl Path 1750051) helped at all? That patch is reported to cut Tcl variable memory usage in half. If I still don't get it, perhaps a proposed patch is the clearest way for you to express to us precisely what it is that you want.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
Ticket change [01957463c8] (rid 119504) by msofer on 2007-08-22 22:46:16:
- closedate changed to: "2007-08-22T15:46:16"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Originator: NO There is no way of doing what you want, not in Tcl. The first example could indeed be done via traces, and it could (in principle) be done within the core. But at a huge cost in complexity, and ... having options to [set]? I do not think this can fly. The second example is fundamentally impossible: you are asking the variable myString to be able to only hold string values (that cannot be reinterpreted as something else? NOT Tcl at all!). You are also asking the value $myString to KNOW it is held in such a variable. I do not have enough info to understand where you see memory or runtime savings with such an approach, should it be feasible at all. Please provide detailed info - or even a patch, as suggest below.
- login: "msofer"
- mimetype: "text/plain"
- status changed to: "Pending"
- username: "msofer"
Ticket change [cc2ee122c3] (rid 95646) by sf-robot on 2007-09-06 09:20:05:
- closedate changed to: "2007-09-06T02:20:05"
- closer changed to: "sf-robot"
- icomment:
Logged In: YES user_id=1312539 Originator: NO This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"