Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 241db807bb0bb3e651f83b28ab70273d5441c3c5
Ticket: 1787846fffffffffffffffffffffffffffffffff
"wideInt" objType registration
User & Date: das on 2007-09-04 22:29:29
Changes

  1. icomment:
    Logged In: YES 
    user_id=90580
    Originator: NO
    
    and for more context, my email exchange with Joe English (prior to the chat above):
    
    From: Daniel A. Steffen
    Subject: Re: "wideInt" Tcl_ObjType
    Date: Tue, 4 Sep 2007 08:50:51 +1000
    To: Joe English
    Cc: kbk
    
    
    Hi Joe,
    
    On 04/09/2007, at 4:09, Joe English wrote:
    
    > Daniel --
    > 
    > Re: recent change to generic/tclObj.c,
    > 
    > | * generic/tclObj.c (TclInitObjSubsystem): restore registration of the
    > | "wideInt" Tcl_ObjType for compatibility with 8.4 extensions that access
    > | the tclWideIntType Tcl_ObjType; add setFromAnyProc for tclWideIntType.
    > 
    > 
    > Just confirmed with Kevin Kenny that this was removed 
    > intentionally as part of the TIP#237 implementation 
    > (generic/tclObj.c r1.96, 2005/10/08; see also 
    > kennykb-numerics-branch).
    
    yes, I did realize that and looked into the CVS history as well, I committed the
    restoration fully aware of all this. I also reread briefly what the TIP says
    about Tcl_WideInt, but the reality in the code seemed to differ significantly
    with the stated desire to fully remove wide ints (which I chalked up to an
    obsolete TIP...)
    
    > Also, there is growing 
    > consensus that neither the core nor extensions
    > should call Tcl_RegisterObjType() at all; 
    > Tcl_ConvertToType() is broken as designed.
    
    I understand this, and I am in fact not using Tcl_ConvertToType() with the
    "wideInt" type; as far as I am concerned the new SetWideIntFromAny could be
    reverted, it was just added for completeness (and does not in fact convert to a
    wide int representation, same as SetIntFromAny).
    
    there is ample precedent in 8.5 for the restoration of Tcl_ObjType registrations
    that were removed and affected extensions: "boolean", "list" and "procbody" all
    had this happen, c.f. ChangeLog.2005, so I did not think much of reverting the
    "wideInt' registration removal when unintended consequences showed up.
    
    > Unless you know of a specific extension that relies on
    > the "wideInt" type being registered, it would be a good
    > idea to revert this change.
    
    the extension in question is ffidl, which I'm currently updating to support 8.5,
    my commits yesterday all have to do with this...
    
    ffidl needs to support passing 64bit numbers back and forth between tcl procs
    and user-specified C calls, it uses the "wideInt" Tcl_ObjType to compare against
    a given Tcl_Obj's type to avoid slow and potentially lossy conversions.
    
    existing ffidl sources (and binaries) broke when run against 8.5 because of the
    "wideInt" registration removal (arguably an error in ffidl, it did not expect
    Tcl_GetObjType to fail). I have fixed that bug, but the need to know (cheaply)
    if a given tcl object needs 64bit storage remains.
    
    Cheers,
    
    Daniel
    
    
    > Thanks,
    > 
    > 
    > --Joe English
    
    
    
  2. login: "das"
  3. mimetype: "text/plain"
  4. username: "das"