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:
- tcloo.patch [download] added by nijtmans on 2010-03-02 05:26:43. [details]