Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4a3c4dac5620833cf02586f77552283f93ea60531213f2ea32ed6aba083cb574
Ticket: 9e4edfc3ff6a1485b2ea86d5bc1f7201cfe34e3a
TIP 595 did more than it talks about
User & Date: pointsman on 2023-01-27 17:03:34
Changes

  1. icomment:
    Well, it's not only about compatibility Tcl 8 / Tcl 9 but also about build-in versus dynamic loaded.
    
    Since almost ever tdom has
    
        Tcl_StaticPackage(interp, "tdom", Tdom_Init, Tdom_SafeInit);
    
    in its tclAppInit.c used to build a tclsh with tdom build in.
    
    So while with a dynamic loaded tdom
    
    load {} Tdom $interp
    
    infact works after the TIP 595 this does not work with build-in tdom, for which this must still read
    
    load {} tdom $interp.
    
    Loading tdom into a child interp is done in the test suite, which I regulary run with standard tclsh as well as tclsh build-in with tdom. And I'm aware that there are folks out there which does use tclsh with statically build-in tdom.
    
    So changing the second argument of Tcl_StaticPackage() in my tclAppInit.c just to "Tdom" has the risk that current working code of Tcl 8 users which uses tdom build in will fail.
    
    So I'm looking out for the most simple way to make this work not only for Tcl 8 and Tcl 9 but also for dynamic loaded versus build-in.
    
    Last invasive would perhaps to just register "tdom" as well as "Tdom" as build in. So just do both
    
        Tcl_StaticPackage(interp, "tdom", Tdom_Init, Tdom_SafeInit);
        Tcl_StaticPackage(interp, "Tdom", Tdom_Init, Tdom_SafeInit);
    
    I would still have to change the test suite but with this at least current working Tcl 8 code will still work regardless of tDOM loaded dynamically or build-in.
    
    Do you see any problem with this double announce with two names of one build-in extension?
    
  2. login: "pointsman"
  3. mimetype: "text/plain"