Menu

#148 Tcl_Obj interface enhancement

open
6
2009-05-11
2000-10-26
Anonymous
No

OriginalBugID: 2032 RFE
Version: 8.1
SubmitDate: '1999-05-10'
LastModified: '2000-04-02'
Severity: LOW
Status: UnAssn
Submitter: pat
ChangedBy: hobbs
OS: Other
OSVersion: This RFE applies to all operating systems and all future Tcl ver
Machine: NA
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'

Name:
Jacob Levy

Comments:
I had hoped, based on a conversation with Brent, that this change would
be in Tcl 8.1. It is not one of the many other good things that are
described in the release notes, and I didn't find it in the Tcl 8.1
sources, so it seems this RFE didn't make it in.

As Tcl is increasingly being used in situations that require the
presence of many extensions, I believe this RFE will become more and
more important. For example, it would be extremely beneficial when both
TclBlend and an ActiveX extension are used in the same Tcl, because both
of these use TclObj objects in the way I described above.

DesiredBehavior:
Currently, it is difficult to manage two or more Tcl extensions that
create TclObj objects that behave as procedures as well as values.
Specifically, the conversion between use for procedures and use for
values may lose information. This is because the conversion uses a
specific field in the TclObj object to preserve information about the
previous use. Each extension must assume that if that field is not NULL
then it contains a value representing *its* previous use of that object.
Obviously, with two or more extensions using the same field this will
cause havoc.

Based on a discussion with Brent Welch, I'd like to suggest an
alternative approach to the way TclObj objects work: instead of doing
type conversion when a different use is required, extend the functional
interface to include "use-as-string" and "use-as-procedure" functions in
addition to the current lifecycle functions. I can even see
"use-as-list" and "use-as-associative-array" and many other functions.

Discussion

  • Donal K. Fellows

    This would be incompatible with many extensions; I doubt anything will get done before 9.0...

     
  • Andreas Kupries

    Andreas Kupries - 2000-11-17
    • priority: 5 --> 6
    • milestone: 102424 --> 102413
     
  • Andreas Kupries

    Andreas Kupries - 2000-11-17

    Note that Paul Duffin's Interfaces (in his Feather) are a generalization of this idea. We should get back in contact with him.

     
  • Don Porter

    Don Porter - 2001-04-03
    • labels: 104239 --> 10. Objects
     
  • Don Porter

    Don Porter - 2003-11-12
    • assigned_to: nobody --> dkf
     
  • Donal K. Fellows

    • summary: TclObject interface enhancement --> Tcl_Obj interface enhancement