Check-in [6fc9ac29eb]

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:fix for markdown dialect
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:6fc9ac29eb3d5443c570df594eb9be363dc983cdec1652ea5d86c611906b0082
User & Date: dkf 2019-01-01 17:07:55
Context
2019-01-02
13:03
Escape some characters so that <<WidgetViewSync>> displays properly in the html check-in: 0cf378bdd2 user: fvogel tags: trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tip/531.md.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Rationale

Users that are creating interpreters are often getting errors because they are getting the `Tcl_CreateInterp` macro.
This error is a runtime null pointer exception which several users find confusing.
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.
By providing a plain function, the users can have a easier time embedded interperters and using stubs.

```
/usr/local/include/tcl8.6/tclDecls.h:#define Tcl_CreateInterp \
/usr/local/include/tcl8.6/tclDecls.h- (tclStubsPtr->tcl_CreateInterp) /* 94 */
```

# Specification

There will be a new function in `libtclstub??.a` that always performs interpreter initialization and stub table initialization.
The signature is **Tcl\_CreateInterpWithStubs**(const char \*_version_, int _exact_).
The _version_ and _exact_ parameters match `Tcl_InitStubs`.

On error NULL is returned instead of a TCL interpreter.
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.
(That could be an error, someone could clarify that for me.)

## Example Implementation

``` 
/* must be compiled without stubs */

#undef USE_TCL_STUBS
#include <tcl.h>

Tcl_Interp *
Tcl_CreateInterpWithStubs(
    const char *version,
	int exact)
{
    Tcl_Interp *interp = Tcl_CreateInterp();

    if (Tcl_Init(interp) == TCL_ERROR ||
            Tcl_InitStubs(interp, version, exact) == NULL ||
            Tcl_PkgRequire(interp, "Tcl", version, exact) == NULL) {
        return NULL;
    }

    return interp;
}
```

# Implementation

Please refer to the `tip-???` branch of the core Tcl repository.

# Backwards Compatibility

This is a new function in the TCL C API.

# Copyright

This document has been placed in the public domain.







<
|
|
<













<
|

|
|

|
|
|
|
|
|

|
|
|
|
|

|
|
<












22
23
24
25
26
27
28

29
30

31
32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
71
72
73
74
75
# Rationale

Users that are creating interpreters are often getting errors because they are getting the `Tcl_CreateInterp` macro.
This error is a runtime null pointer exception which several users find confusing.
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.
By providing a plain function, the users can have a easier time embedded interperters and using stubs.


    /usr/local/include/tcl8.6/tclDecls.h:#define Tcl_CreateInterp \
    /usr/local/include/tcl8.6/tclDecls.h- (tclStubsPtr->tcl_CreateInterp) /* 94 */


# Specification

There will be a new function in `libtclstub??.a` that always performs interpreter initialization and stub table initialization.
The signature is **Tcl\_CreateInterpWithStubs**(const char \*_version_, int _exact_).
The _version_ and _exact_ parameters match `Tcl_InitStubs`.

On error NULL is returned instead of a TCL interpreter.
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.
(That could be an error, someone could clarify that for me.)

## Example Implementation


    /* must be compiled without stubs */

    #undef USE_TCL_STUBS
    #include <tcl.h>

    Tcl_Interp *
    Tcl_CreateInterpWithStubs(
        const char *version,
        int exact)
    {
        Tcl_Interp *interp = Tcl_CreateInterp();

        if (Tcl_Init(interp) == TCL_ERROR ||
                Tcl_InitStubs(interp, version, exact) == NULL ||
                Tcl_PkgRequire(interp, "Tcl", version, exact) == NULL) {
            return NULL;
        }

        return interp;
    }


# Implementation

Please refer to the `tip-???` branch of the core Tcl repository.

# Backwards Compatibility

This is a new function in the TCL C API.

# Copyright

This document has been placed in the public domain.