Re: export & public

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

I am only replying so that my silence is not interpreted as anything, other than my disinterest in trying to have yet another fruitless dialog with Mr Kachan.

This is a programming language and not English. It is based upon the English language and reserves the right to adapt existing words to express concepts that are not covered by existing English words. Even in English, it is common for a given word to have different meanings depending on the context that the word is found in. You might like to broaden your mind to encompass the idea that sees the Euphoria language as a new context for English words.

With this in mind, a "public" symbol has been re-used to to express the concept that a symbol is "available to anyone (the public), so long as they explicitly choose to include it". As an analogy, a playground might be declared as public, but it does not mean that you can use it until you actually go there.

The idea of a "public" include is a type of shorthand insomuch as the public symbols in the file being included are deemed to have been declared as public in the file using the "public include". There is no obvious word to use from English to express this idea. An analogy might be that you have a ticket to go from London to Melbourne, but on route you need to change planes at Dubai - You don't have a ticket for Dubai but the one you have allows access to any number of way-stops on the main route. In a similar idea, a public symbol is normally only a "ticket" to the next stop, but a "public include" enables that "ticket" to be used as a transit ticket to a third destination. This is normally only used by library authors who are writing a large library consisting of many files instead on one large monolithic file. The "public" symbols are there for people to access the library's API even though they might have been declared in sub-library files. THat sort of implementation detail is not relevant to the application author.

Consider the Win32lib. It consists of many files. Each of these files can declare public symbols which are intented to be used by the application coder. However, because a public symbol is only made available to files directly including it, these sub-library declarations would actually be invisible to the application. To assist library writers, we developed the idea of a "public" include. Its job to make available public symbols in sub-library files to the application coder - AS IF they were declared "public" in the main library file.

The term "export" is being used to express the concept that a symbol might be needed within a multi-file library but is not really a part of the API. This is a way to allow library authors to develop a multi-file library that contains symbols that are designed to only be used internally within the library's own files. These "export" symbols behave like "public" ones in that they are exposed to the file that includes them, but a "public include" does not propagate them any further along the include chain. Again, there is not a simple English word to cover this concept. (On a personal note, I voted against the word "export" and wanted to use the word "library" because these are library-internal symbols, but I was out voted - such is life.)

I must say that the terms "up" and "and_up" are very poor choices. There is no "up" as a direction of propagation. That concept depends on the model one uses to describe the relationships between files in a Euphoria application. It might apply to an inverted tree model, but it is not an absolute term that applies to all models. However, if your Russian speakers will get benefit then of course use these approximations.

This is not a discussion; just my thoughts on the subject.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu