Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-05-11
21:13 • Closed ticket [219291ffff]: Support for Linking Tcl Variables and C Variables Co... artifact: b0713f58a9 user: dkf
2004-10-04
21:00 • Ticket [219291ffff]: 4 changes artifact: 7018392d75 user: dkf
2002-01-17
01:49 • Ticket [219291ffff]: 1 change artifact: 4e7aa43d2e user: hobbs
2001-04-04
04:46 • Ticket [219291ffff]: 1 change artifact: bfd2d14772 user: dgp
2001-02-07
22:42 • Ticket [219291ffff]: 1 change artifact: 32eb33360c user: dkf
2000-11-08
20:28 • Ticket [219291ffff]: 1 change artifact: af7789e5f1 user: dkf
2000-10-26
05:10 • New ticket [219291ffff]. artifact: ce6a8add89 user: nobody

Support for Linking Tcl Variables and C Variables Containing

Closed / Fixed219291ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 18 years ago
Descriptionplain2000-10-26 05:10:05
OriginalBugID: 2275 RFE
Version: 8.0.4
SubmitDate: '1999-06-21'
LastModified: '2000-10-25'
Severity: LOW
Status: UnAssn
Submitter: techsupp
OS: Solaris
OSVersion: 2.7
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:
Donal K. Fellows

Comments:
This code has been tested and found to work fine on Solaris (various
    versions,) SunOS 4.1 (where it was developed) and Linux (various
    versions)

DesiredBehavior:
This enhancement to the general mechanism for linking Tcl and C
    variables allows code that wishes to link an internal variable that
    contains a reference to a Tcl_Obj structure to the general Tcl-level
    interface to do so far more efficiently.  In particular, it prevents the
    (sometimes significant) degradation in performance that would otherwise
    be necessary if a scheme based on the standard Tcl_LinkVar() behaviour
    was used (which would be due to the conversion between strings and
    values) and can efficiently cope with any objects a programmer may wish
    to pass.
    
    The changes that I've made are currently structured as being in separate
    files, and as such they have no general impact upon the rest of Tcl.
    Integrating them should be a breeze (apart from writing the
    documentation and test suite <sigh>)
    
    As the code has been in serious use for around 2 years now (as part of a
    scheme to link properties of objects to Tcl variables so they can be
    joined to Tk entry widgets in an OO scheme I'm using in an application
    I'm working on,) I fully expect it to be free of bugs.  In particular,
    the code has no internal memory leaks (when used correctly, of course)
    and nor does it leak references or cause anything to get freed to early
    (which was the source of many wierd bugs, admittedly...)
    
    My implementation of the above feature (I emphasize that this is *not* a
    patch) and some minimalist documentation is available at:
       http://www.cs.man.ac.uk/~fellowsd/tcl/#scripts/linkObj
    
    I do not class this request-for-enhancement-inclusion as a show-stopper
    at all, since I have to use enhanced interpreters in any case (there is
    the rest of the OO code, and some proprietory display enhancements, all
    of which are absolute necessities at the moment.)
dkf Ticket [219291ffff]: 1 change [History diff]2000-11-08 20:28:51
dkf Ticket [219291ffff]: 1 change [History diff]2001-02-07 22:42:17
dgp Ticket [219291ffff]: 1 change [History diff]2001-04-04 04:46:23
hobbs Ticket [219291ffff]: 1 change [History diff]2002-01-17 01:49:44
dkfplain2004-10-04 21:00:38
Logged In: YES 
user_id=79902

There has also been interest shown on c.l.t for linking with
float (single-precision IEEE) variables.
dkfplain2009-05-11 21:13:09
allow_comments - 1

8.5 onwards supports linking of a wider range of basic types, but not of Tcl_Objs; those are perhaps best done directly through traces. In any case, I'm not pushing for this one any more.
Log in (anonymous is fine) to add a comment.