Tcl Source Code

View Ticket
Login
Ticket UUID: 2961556
Title: typedef functions in stead of function pointers
Type: Patch Version: None
Submitter: nijtmans Created on: 2010-03-01 22:26:43
Subsystem: 35. TclOO Package Assigned To: dkf
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2010-03-05 22:39:55
Resolution: Accepted Closed By: dkf
    Closed on: 2010-03-05 15:39:55
Description:
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
User Comments: dkf added on 2010-03-05 22:39:55:

allow_comments - 1

Also applied to standalone extension.

dkf added on 2010-03-05 22:33:02:
Applied to Tcl HEAD.

nijtmans added on 2010-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  :-)

kennykb added on 2010-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".

dkf added on 2010-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.

nijtmans added on 2010-03-02 05:26:43:

File Added - 365063: tcloo.patch

Attachments: