Check-in [04c80b80d0]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added TIP 531, with apologies to Shannon Noe for taking so long to get this in
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:04c80b80d0741a52196d9cce8ad291e42fe6e4047f3dac4612745d36fc303fd3
User & Date: dkf 2019-01-01 17:05:08
Context
2019-01-01
17:07
fix for markdown dialect check-in: 6fc9ac29eb user: dkf tags: trunk
17:05
Added TIP 531, with apologies to Shannon Noe for taking so long to get this in check-in: 04c80b80d0 user: dkf tags: trunk
2018-12-18
17:07
TIP529: worded next insights: property functions and new call functions check-in: 5376cf14bc user: oehhar tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to index.json.

     1      1   {"tip": {
            2  +	"531":{"url":"./tip/531.md","":"","keywords":"Tcl, stubs","created":"14-Dec-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 531: Static Tcl Interpreter Creation Function","/usr/local/include/tcl8.6/tcldecls.h":"#define Tcl_CreateInterp \\","author":["Shannon Noe <shannon.noe@flightaware.com>"],"is-jest":false},
            3  +	"530":{"url":"./tip/530.md","tcl-ticket":"a09031e288","created":"13-Dec-2018","post-history":"","state":"Draft","tcl-version":"8.6, 8.7","vote":"Pending","type":"Project","title":"# TIP 530: Control over performance impact of TIP 280","author":["Leon Manukyan <leon.manukyan@gmail.com>"],"is-jest":false},
     2      4   	"529":{"url":"./tip/529.md","keywords":"Tk, image","created":"07-Dec-2018","state":"Draft","tk-branch":"tip-529-image-metadata","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 529: Add metadata dict property to tk photo image","author":["Harald Oehlmann <oehhar@users.sourceforge.net>"],"is-jest":false},
     3      5   	"528":{"url":"./tip/528.md","created":"05-Dec-2018","post-history":"","state":"Draft","tk-branch":"offsetof","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 528: Deprecate Tk_Offset()","author":["Jan Nijtmans <jan.nijtmans@gmail.com>"],"is-jest":false},
     4      6   	"527":{"url":"./tip/527.md","created":"26-Nov-2018","post-history":"","state":"Draft","tcl-branch":"sebres-8-6-timerate","tcl-version":"8.5","vote":"Pending","type":"Project","title":"# TIP 527: New measurement facilities in TCL: New command timerate.","discussions-to":"news:comp.lang.tcl","author":["Sergey G. Brester <sebres@users.sourceforge.net>"],"is-jest":false},
     5      7   	"526":{"url":"./tip/526.md","created":"08-Nov-2018","post-history":"","state":"Draft","tcl-version":"9.0","vote":"Pending","type":"Project","title":"# TIP 526: Make [expr] Only Accept One Argument","author":["Donal K. Fellows <donal.k.fellows@manchester.ac.uk>"],"is-jest":false},
     6      8   	"525":{"url":"./tip/525.md","keywords":"Tcl, testing, continuous integration","state":"Final","type":"Project","author":["Donal K. Fellows <donal.k.fellows@manchester.ac.uk>"],"vote-results":"8/0/0 accepted","votes-for":"KBK, SL, AF, DGP, FV, DKF, AK, JN","votes-against":"none","created":"24-Oct-2018","title":"# TIP 525: Make Tcltest Report Overall Success in a Machine-Readable Way","post-history":"","vote":"Done","tcl-version":"8.5","votes-present":"none","is-jest":false},
     7      9   	"524":{"url":"./tip/524.md","keywords":"Tcl, object orientation, customization","state":"Final","vote-summary":"Accepted 2/0/4","type":"Project","author":["Donal K. Fellows <donal.k.fellows@manchester.ac.uk>"],"votes-against":"none","votes-for":"DKF, JN","created":"23-Oct-2018","title":"# TIP 524: Custom Definition Dialects for TclOO","post-history":"","vote":"Done","tcl-version":"8.7","tcl-branch":"tip-524","votes-present":"BG, KBK, FV, SL","is-jest":false},
     8     10   	"523":{"url":"./tip/523.md","keywords":"queue, stack, pop","state":"Final","vote-summary":"Accepted 7/0/0","type":"Project","author":["Peter Spjuth <peter.spjuth@gmail.com>"],"votes-against":"none","votes-for":"DKF, BG, KBK, JN, DGP, FV, SL","created":"22-Oct-2018","title":"# TIP 523: New lpop command","post-history":"","vote":"Done","tcl-version":"8.7","tcl-branch":"tip-523","votes-present":"none","is-jest":false},
................................................................................
   526    528   	"5":{"url":"./tip/5.md","created":"17-Oct-2000","post-history":"","state":"Final","vote":"Done","tcl-version":"8.4","type":"Project","title":"# TIP 5: Make TkClassProcs and TkSetClassProcs Public and Extensible","author":["Eric Melski <ericm@ajubasolutions.com>"],"is-jest":false},
   527    529   	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news:comp.lang.tcl","author":["Brent Welch <welch@acm.org>","Donal K. Fellows <fellowsd@cs.man.ac.uk>","Larry W. Virden <lvirden@cas.org>","Larry W. Virden <lvirden@yahoo.com>"],"is-jest":false},
   528    530   	"3":{"url":"./tip/3.md","created":"14-Sep-2000","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <a.kupries@westend.com>","Donal K. Fellows <fellowsd@cs.man.ac.uk>"],"is-jest":false},
   529    531   	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <a.kupries@westend.com>","Donal K. Fellows <fellowsd@cs.man.ac.uk>","Don Porter <dgp@users.sourceforge.net>","Mo DeJong <no@spam.com>","Larry W. Virden <lvirden@yahoo.com>","Kevin Kenny <kennykb@acm.org>"],"is-jest":false},
   530    532   	"1":{"url":"./tip/1.md","created":"14-Sep-2000","post-history":"","state":"Active","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <donal.fellows@cs.man.ac.uk>"],"is-jest":false},
   531    533   	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <ouster@pacbell.net>"],"is-jest":false},
   532    534   	"@min": 0,
   533         -	"@max": 529
   534         -}, "@timestamp": 1544524939}
          535  +	"@max": 531
          536  +}, "@timestamp": 1546362270}

Changes to index.md.

   117    117   <th>Tcl Version</th>
   118    118   <th>Status</th>
   119    119   <th>Title</th>
   120    120   <th>Impl.</th>
   121    121   </tr></thead><tbody>
   122    122   
   123    123   <tr class='project projectdraft projectdraft87 project87'>
          124  +<td valign='top'><a href='./tip/531.md'>531</a></td>
          125  +<td valign='top'>Project</td>
          126  +<td valign='top'>8.7</td>
          127  +<td valign='top'>Draft</td>
          128  +<td valign='top'># TIP 531: Static Tcl Interpreter Creation Function</td>
          129  +<td></td>
          130  +</tr>
          131  +<tr class='project projectdraft projectdraft86 project86'>
   124    132   <td valign='top'><a href='./tip/530.md'>530</a></td>
   125    133   <td valign='top'>Project</td>
   126    134   <td valign='top'>8.6, 8.7</td>
   127    135   <td valign='top'>Draft</td>
   128    136   <td valign='top'># TIP 530: Control over performance impact of TIP 280</td>
   129         -<td valign='top'></td>
          137  +<td valign='top'><a href='/tcl/tktview/a09031e288'>Link</a></td>
   130    138   </tr>
   131    139   <tr class='project projectdraft projectdraft87 project87'>
   132    140   <td valign='top'><a href='./tip/529.md'>529</a></td>
   133    141   <td valign='top'>Project</td>
   134    142   <td valign='top'>8.7</td>
   135    143   <td valign='top'>Draft</td>
   136    144   <td valign='top'># TIP 529: Add metadata dict property to tk photo image</td>

Added tip/531.md.

            1  +# TIP 531: Static Tcl Interpreter Creation Function
            2  +	Author:         Shannon Noe <shannon.noe@flightaware.com>
            3  +	State:          Draft
            4  +	Type:           Project
            5  +	Vote:           Pending
            6  +	Created:        14-Dec-2018
            7  +	Post-History:  
            8  +	Keywords:       Tcl, stubs
            9  +	Tcl-Version:    8.7
           10  +----
           11  +
           12  +# Abstract
           13  +
           14  +This TIP adds a helper function to the tclstubs library for creating an interpreter.
           15  +The `Tcl_CreateInterp` function is dependent on the order defining `USE_TCL_STUBS` and inclusion of `tcl.h`.
           16  +When users get this wrong the error is a null pointer exception (NPE) on the stubs table.
           17  +For some TCLers/C users this takes a bit of digging to unravel the cause of the NPE.
           18  +
           19  +Therefore, I propose a new function `Tcl_CreateInterpWithStubs` which is always fully independent of `USE_TCL_STUBS`. 
           20  +This function will be part of the libtclstub87.a library.
           21  +
           22  +# Rationale
           23  +
           24  +Users that are creating interpreters are often getting errors because they are getting the `Tcl_CreateInterp` macro.
           25  +This error is a runtime null pointer exception which several users find confusing.
           26  +The user as to be astute enough to follow instructions and see that `USE_TCL_STUBS` will replace a C function call with a macro.
           27  +By providing a plain function, the users can have a easier time embedded interperters and using stubs.
           28  +
           29  +```
           30  +/usr/local/include/tcl8.6/tclDecls.h:#define Tcl_CreateInterp \
           31  +/usr/local/include/tcl8.6/tclDecls.h- (tclStubsPtr->tcl_CreateInterp) /* 94 */
           32  +```
           33  +
           34  +# Specification
           35  +
           36  +There will be a new function in `libtclstub??.a` that always performs interpreter initialization and stub table initialization.
           37  +The signature is **Tcl\_CreateInterpWithStubs**(const char \*_version_, int _exact_).
           38  +The _version_ and _exact_ parameters match `Tcl_InitStubs`.
           39  +
           40  +On error NULL is returned instead of a TCL interpreter.
           41  +Without this pointer there is no way to obtain extended error codes, but the trade off is that it makes the API much easier to use.
           42  +(That could be an error, someone could clarify that for me.)
           43  +
           44  +## Example Implementation
           45  +
           46  +``` 
           47  +/* must be compiled without stubs */
           48  +
           49  +#undef USE_TCL_STUBS
           50  +#include <tcl.h>
           51  +
           52  +Tcl_Interp *
           53  +Tcl_CreateInterpWithStubs(
           54  +    const char *version,
           55  +	int exact)
           56  +{
           57  +    Tcl_Interp *interp = Tcl_CreateInterp();
           58  +
           59  +    if (Tcl_Init(interp) == TCL_ERROR ||
           60  +            Tcl_InitStubs(interp, version, exact) == NULL ||
           61  +            Tcl_PkgRequire(interp, "Tcl", version, exact) == NULL) {
           62  +        return NULL;
           63  +    }
           64  +
           65  +    return interp;
           66  +}
           67  +```
           68  +
           69  +# Implementation
           70  +
           71  +Please refer to the `tip-???` branch of the core Tcl repository.
           72  +
           73  +# Backwards Compatibility
           74  +
           75  +This is a new function in the TCL C API.
           76  +
           77  +# Copyright
           78  +
           79  +This document has been placed in the public domain.