Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0b662a2833c2136183cfd49478dd7ee8f85ec113418a66f7ef9f3421024d8fc6
Ticket: 3bb3bcf2da5bfe20b1ab863fd2de940bd04f4aaf
Adding support for 8.7/9.0 to Tcl.pm, Tkinter
User & Date: jan.nijtmans on 2022-09-06 07:12:10
Changes

  1. assignee changed to: "jan.nijtmans"
  2. icomment:
    > One part I am still trying to understand is how to handle boolean types
    
    Well, having a short look at the code, this won't work for your case:
    
    <pre>
        Tcl_NewBooleanObj(0);
    </pre>
    
    The reason: this will create an integer object, not a boolean one. If you want a boolean, do:
    
    <pre>
        Tcl_Obj boolObj = Tcl_NewStringObj("true", );
        int value;
        Tcl_GetBooleanFromObj(NULL, boolObj, &value);
    </pre>
    
    Then you can be sure that boolObj->typePtr will be the typePtr you want.
    
    The reason for the change is that in Tcl 8.7, the boolean values is stored in internalRep->longValue, in Tcl 9.0 it's stored in internalRep->wideValue (making it the same as for integers). External code should not assume anything about the internal representation, but code that does should still work in Tcl 8.7. Using "Tcl_GetBooleanFromObj" should do the trick, without assuming anything about the internal representation of booleans.
    
    Hope this helps! Feel free to ask more
    
  3. login: "jan.nijtmans"
  4. mimetype: "text/x-fossil-wiki"