Re: export & public

new topic     » goto parent     » topic index » view thread      » older message » newer message
DanM said...
mattlewis said...
DanM said...

Might either of the words "private" or "restrict" better communicate the intention of the word "export"?

Export means "to send an item out from", without implying any innate restriction as to where the item might end up at, which seems to not be what is intended by using it in V4.0

"private" and "restrict" both seem to fairly clearly indicate that a symbol referenced by them is only available for use by the file that included the file containing the symbol.

I think that private and restrict are counter-intuitive in this usage, since they both seem to imply the opposite of other files being able to see the symbols.

Perhaps something like "friend" would be a better term than "export". I'm thinking of a C concept where the friends of a class can see the class' privates. It's not a perfect analogy.

Matt

I'm not sure I'd agree that they're counter-intuitive, as "private" (replacing "export") suggests available to the owner only (like a private journal), and one could consider the including file as being the owner of the included file, so any "private" symbols in the included file would be available to, and only to, the including file.

And if "restrict" (or "restricted") were to replace "public" (forget about my original suggestion above to have it maybe replace "export"), then that also is not counter-intuitive, because "restricted access to something" just means some access is allowed while some is not, and then "unrestrict include foo" would mean that even more access is granted, though not global access.

Just a thought smile

Dan

Everywhere I have seen the word private, it means specifically, outside the immediate scope, no one can access this item. The scope being a class or a file. The idea of a private journal is a good analogy for every day objects, but is counter intuitive compared to all programming languages I've ever used.

Jeremy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu