|
2008-02-11
| ||
| 05:13 | • Closed ticket [1890579fff]: CMethod API for TclOO methods (similar to ProcedureM... artifact: 2db1ef1c68 user: dkf | |
| 05:13 | • Ticket [1890579fff]: 4 changes artifact: b5de964dd4 user: dkf | |
|
2008-02-10
| ||
| 12:37 | • New ticket [1890579fff]. artifact: ed8e1316c9 user: wiede | |
CMethod API for TclOO methods (similar to ProcedureMethod)
Closed / Rejected1890579fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-02-10 12:37:12
For itcln-ng and maybe also for others it would be nice to allow C-implemented functions to be used a method implementation. Right now there is the ProcedureMethod interface (besides others) for adding methods to TclOO objects and classes. I think it would be very helpful to have a similar CMethod interface. The interface should be very similar to Procedure Method in that instead of Tcl_Obj *bodyObj there is a Tcl_ObjCmdProc *cMethod as a parameter to the functions of that API. The rest of all the necessary API functions should be identical (very similar) to the ProcedureMethod API functions. Instead of TclProcCompileProc(...) and TclObjInterpProcCore(...)there is a call to (cmPtr->cMethodPtr)(...) For the script level I think it is not mandatory to have interfaces. Just for info: Itcl-ng uses a Register_CProc API to make the registration of functions with signature Tcl_ObjCmdProc available. And at the script level there is a cmethod additional interface for connecting script level method names with registered C-level methods. I have a prototype implementation (in the itcl-ng sources) running, which has a lot of redundant duplicate code from file tclOOMethod.c. So I think that part would better fit there. Donal, as I know you like to implement it your way, I think the description here is enough for you, otherwise please let me know.
dkfplain2008-02-11 05:13:50
Logged In: YES user_id=79902 Originator: NO There is already a public API for plugging in methods implemented in your own way. I see no need to create another. The API is not like that of a standard Tcl command because an additional argument (describing the context within which the method implementation was called) is needed.
dkf Closed ticket [1890579fff].
[History diff]2008-02-11 05:13:51
Log in (anonymous is fine) to add a comment.