Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-03-05
22:39 • Closed ticket [2961556fff]: typedef functions in stead of function pointers ... artifact: cd9c5f9509 user: dkf
22:33 • Ticket [2961556fff]: 5 changes artifact: 888dbf5bd4 user: dkf
22:02 • Ticket [2961556fff]: 4 changes artifact: f6acf695ea user: nijtmans
19:49 • Ticket [2961556fff]: 4 changes artifact: 355ad74571 user: kennykb
17:51 • Ticket [2961556fff]: 4 changes artifact: 287cb75256 user: dkf
2010-03-02
05:26 • Add attachment tcloo.patch to ticket [2961556fff] artifact: 5c21d70348 user: nijtmans
05:26 • Ticket [2961556fff] typedef functions in stead of function pointers status s... artifact: 91e3129e90 user: nijtmans
2010-03-01
22:26 • New ticket [2961556fff]. artifact: 668f75f8d5 user: nijtmans

typedef functions in stead of function pointers

Closed / Accepted2961556fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-03-01 22:26:43
In all of Tcl, functions typedefs look like:
   typedef void (Tcl_FreeProc) (char *blockPtr);
however, in TclOO, we have:
   typedef void (*Tcl_MethodDeleteProc)(ClientData clientData);

I would like to suggest to keep function typedefs the
same as all other functions typedefs in Tcl. Here is a
patch that does exactly this.

It has the advantage, that function pointers can be
easily identified, simply because they really look like
a pointer.

This change is binary compatible, but not 100%
source compatible. If an extension defines a variable
of type function pointer, the syntax is a little bit different,
a '*' has to be added. itcl does that once, the itcl change
is included in the patch as well.

If accepted, this has to be coordinated with Arnulf.
Both TclOO and itcl are still in beta, so I don't think
it's too late to fix this inconsitance between TclOO
and other Tcl parts.

Regards,
        Jan Nijtmans
nijtmansplain2010-03-02 05:26:43
File Added - 365063: tcloo.patch
dkfplain2010-03-05 17:51:17
I'm not opposed to doing this (in part because I floundered back and forth on this a few times during development!) but it is an issue with source compatibility.

Needs to be coordinated with the TDBC drivers too; some of them are implemented in C.
kennykbplain2010-03-05 19:49:44
TDBC's methods are all installed by initialising static Tcl_MethodType structures.
There are no variables of type "pointer to method".
nijtmansplain2010-03-05 22:02:48
Arnulf Wiedemann wrote to me:
>I have no problem to adjust itcl for that, if Donal is
> adjusting that in TclOO.

So, it looks like a go  :-)
dkfplain2010-03-05 22:33:02
Applied to Tcl HEAD.
dkfplain2010-03-05 22:39:55
allow_comments - 1

Also applied to standalone extension.
Log in (anonymous is fine) to add a comment.

Attachments: