Waldek Hebisch wrote:
Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
How about: _gpc_<unitname>_foo { for units } _gpc_rts_foo { for RTS stuff } _gpc_<programname>_foo { for programs }
I don't really mind, but I don't want to have to rename them again sometime later. So we should be sure the new names are "unique enough" if we rename them now.
I think that `_p_initialize' is really the main problem. Namely, it one of few (maybe the only one) rts routine with user visible name -- if `main' is in another language users should call it. And the name is really good (so good that other packages also would like to use it :).
Yes, one of a few -- `_p_finalize' is another one.
For user names the prefix really is `_p__' so there is no conflict (at least ATM). Also, our external names look like:
_p__M3_Foo_S0_Myfun
They already include unit name (`Foo' here) and routine name (forming that names is part of qualified identifier implementation).
These names should be ok, thanks to your encoding.
But there are some explicit linker names where C interfaces are involved (e.g., those units that have C parts, and in the RTS rts.c). These names are explicit, though not user-visible (only needed within the unit and the C code), so they can be changed rather easily, but it has to be done. Also, an encoding as above is probably not well suited here since it has to be written manually. Perhaps we could use something like `_p__M3_Foo_Bar' (the unit name doesn't usually change, and it's length can be counted manually once; the real identifiers don't conflict here as we want to use the same in C, so we don't do overloading etc.). Or what else?
We may easily change the prefix (I see no reason to change the other part, it was specially designed to be unique). However, I think that change in `plotutils' is preferable:
- We need rather large namespace and use only a single prefix
- They use quite a lot of single letter prefixes (and polute namespace quite heavily) so quite likely they will have to change their names anyway
Quite possible. (I haven't looked at plotutils closely.)
- The `_' prefix was intended for language implementation. Its use in general purpose library looks like an abuse
If this is so (I'm not really familiar with those namespace conventions), this would be a rather compelling argument. :-)
What's the mechanism for libraries, double-underscore? (I see that GMP uses `__gmp_*'.) However, ncurses uses `_nc_foo' for private routines, is this wrong then?
- Our `_p_initialize' has to be in implementation space, but is also user visible. AFAICS `plotutils' just want private names which are not intended to be user visible
Yes, then it's clearly easier for them to change.
BTW Has anybody contacted `plotutils' developers? (I did not).
Me neither.
Frank