Re: export & public
- Posted by DanM Dec 05, 2008
- 1291 views
Do I have this right:
"export" is a kind of alternative for "global", in that it allows an "export"ed symbol to be SEEN by the including file, but with the advantage that it can ONLY be seen by the including file?
Whereas "public" is a DIFFERENT alternative for "global", in that if a file says "public include foo", then any of the "public" symbols that were in foo now CAN be seen by ANY FILE that included the file that said "public include foo"?
If that's right, then it would seem that "private" could reasonably be used instead of "export", because any "private" symbol would be only privately available to the immediately including file,
and "restrict" could be used instead of "public", so that a "restrict"ed symbol would normally be only seen by the immediately including file, but with "unrestrict include foo" meaning that any of the ""restrict"ed symbols that were in foo now CAN be seen by ANY FILE that included the file that said "unrestrict include foo"?
So "private" would be one step up from local symbols, and "restrict" (or "restricted"?) would be potentially one-half step above "private", in scope.
Perhaps that might also satisfy translation of keywords from English to other languages?
Dan