Tcl Source Code

View Ticket
13:30 Closed ticket [465213d171]: Tcl_NewMethod() documentation error plus 7 other changes artifact: b352e99fca user: dkf
[465213d171] Documentation correction for Tcl_NewMethod. check-in: 46d2108111 user: dkf tags: trunk
15:54 Ticket [465213d171] Tcl_NewMethod() documentation error status still Open with 4 other changes artifact: 954d8c1b80 user: dgp
15:54 New ticket [465213d171]. artifact: 9226dd2f90 user: dgp

Ticket UUID: 465213d1715f9e2c0eba602a7f802ec4ea11d246
Title: Tcl_NewMethod() documentation error
Type: Bug Version: trunk
Submitter: dgp Created on: 2015-06-19 15:54:10
Subsystem: 35. TclOO Package Assigned To: dkf
Priority: 7 High Severity: Important
Status: Closed Last Modified: 2015-08-18 13:30:39
Resolution: Fixed Closed By: dkf
    Closed on: 2015-08-18 13:30:39
The documentation for Tcl_NewMethod:

       Tcl_NewMethod(interp, class, nameObj, isPublic,
                     methodTypePtr, clientData)


       int isPublic (in)                   A boolean flag saying  whether  the
                                           method is to be exported.

seems to be mistaken.

The implementation of Tcl_NewMethod() calls its third argument "flags"
and it pulls from "flags" the particular bit settings PUBLIC_METHOD
and PRIVATE_METHOD for storing in the new Method struct .

The upshot is that passing the values 1 or 2 or 3 which as booleans
are all the same "true" value, actually will result in different
behaviors, some potentially seriously broken.

Either the documented interface or the implementation should be
chosen to survive, with the other adjusted as needed.  If the interface
is revised, the bit definitions will need exporting.
User Comments: dkf added on 2015-08-18 13:30:39:

Updated the documentation to say that supported values are 0 (non-exported) and 1 (exported), and what those values mean. The other possible values are currently kept for possible future definition.