From: Clif F. <CLIF@CFLYNT.COM> - 2013-11-22 13:55:25
|
> From: Jan Nijtmans <nij...@us...> > Subject: Re: [TCLCORE] Rethinking MODULE_SCOPE > ... > 2013/11/22 Lars Hellstr?m <Lar...@re...>: > > libtommath is definitely one thing. The whole DString subsystem is another > > (though perhaps more for C than C++ programmers, I'd suspect). And there are > > the hashes. The list goes on. > > Reading this, it's really time for TIP #414 to be re-considered. > But that's another topic. > > > I've argued a couple of times before that pushing Tcl as a well-balanced > > library of basic programming utilities for C programmers should be > > considered an important recruitment/marketing tactic for the Tcl community. > > (Whether that requires rethinking MODULE_SCOPE is another matter, which I > > don't feel I have a qualified opinion about.) > > I don't think MODULE_SCOPE needs to be considered. libtommath > already has its own stub table ready to be used, and the DString > functions are already public. And the RegExp engine is already > exported through the public API as well: > > /* 212 */ > EXTERN Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, > const char *pattern); > /* 213 */ > EXTERN int Tcl_RegExpExec(Tcl_Interp *interp, Tcl_RegExp regexp, > const char *text, const char *start); > /* 214 */ > EXTERN int Tcl_RegExpMatch(Tcl_Interp *interp, const char *text, > const char *pattern); > /* 215 */ > EXTERN void Tcl_RegExpRange(Tcl_RegExp regexp, int index, > const char **startPtr, const char **endPtr); > > If functions are missing which are needed to do useful stuff, please > report that! There is no reason why they cannot be added. The Tcl_RegExpCompile, Tcl_RegExpMatch are functions that require Tcl Interp. That's useful for apps that are using the interpreter, but not for an application that's just using the Tcl library as a set of useful tools for "C" programmers. I think MODULE_SCOPE is a good idea - I'm wondering if it's an idea that's being over-applied. This client is the first time I've run into someone using the Tcl libraries without the interp. In their family of products some apps need the interp, and some don't. I tend to see Tcl usage through the eyes of our industrial users, since that's where I do training and contracts. I don't know that we need to tweak Tcl to support the one-off type industrial users, but it's good to support classes of industrial users. In this case, replacing the MODULE_SCOPE with DLLEXPORT in the files we're interested in is a workaround. Perhaps a Tcl or sed script that will rework files if a user requests "--enable_C_export" or such would be a useful option. Or perhaps "MODULE_SCOPE" and "MODULE_SCOPE_GENERIC" (or better wording) for entry points that are truly Tcl internal calls and entry points that can have general use? Cilf -- ... Clif Flynt ... http://www.cwflynt.com ... cl...@cf... ... .. Tcl/Tk: A Developer's Guide (3'd edition) - Morgan Kauffman .. .20'th Annual Tcl/Tk Conference: Sep 23-27 New Orleans, LA, USA. ............. http://www.tcl.tk/community/tcl2013/ ............ |