Tcl Source Code

View Ticket
Login
Ticket UUID: 0f3e1921c558aeb06aa9e7ff1f086383b6895a4e
Title: TIP 426 C API not implemented
Type: Bug Version: 8.7
Submitter: apnadkarni Created on: 2024-05-19 06:34:09
Subsystem: - New Builtin Commands Assigned To: dkf
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2025-01-18 14:48:42
Resolution: None Closed By: nobody
    Closed on:
Description:

Only logging this ticket in case this is an oversight and not intentional. TIP 426 as voted defines the public API's Tcl_RegisterCommandTypeName and Tcl_GetCommandTypeName.

I do not however find these functions defined in tcl.decls.

User Comments: juliannoble2 added on 2025-01-18 14:48:42:
I would like to see this as part of the public API to (hopefully) improve introspection in some mainstream packages.

for example the command created by 'sqlite3 dbcmd' is of type native - and I'd like to identify it as belonging to sqlite3 (for documentation & command completion) without the risk of calling unknown native commands that may have side effects. 

If this were public I'd be inclined to submit an RFE on the sqlite forum for adding a specific type such as sqlite3::dbcmd via this mechanism.

Presumably some guidance for package developers to avoid collisions via something like a prefix matching the package name would be nice too.(?)

I'd be interested also to hear if this may eventually be coming - or if there is perhaps some concern about collisions or type name proliferation?

apnadkarni added on 2024-05-22 03:43:53:
Donal, please close ticket if the functions in question were not exported by intent.

apnadkarni added on 2024-05-20 03:13:30:
I do not have any particular need for the aforementioned functions so I am fine leaving things as they are. Only brought it up in case they were omitted as an oversight and not by intent.

jan.nijtmans added on 2024-05-19 11:21:26:

That said, I don't object to making this public (if there is an interest implementing the Tk-part, as mentioned in the TIP). In that case, I recommend only doing this for 9.0, not for 8.7.


jan.nijtmans added on 2024-05-19 11:15:52:

I don't think it's difficult to add those to the public API: Those functions are MODULE_SCOPE, and named `TclRegisterCommandTypeName`/`TclGetCommandTypeName`. But ... would any extension need those?

I think the answer to this question is `No`, so I would suggest to leave the implementation as-is. We can modify the TIP, mentioning this change-of-insight.