Liste des Groupes | Revenir à cl c |
On 02/12/2024 19:27, Bart wrote:https://github.com/sal55/langs/blob/master/Modules24.mdOn 02/12/2024 15:24, David Brown wrote:As I understood it, or perhaps failed to understand it (after all, it's not as if there are published specifications, references,On 02/12/2024 13:24, Bart wrote:>I would consider any kind of automatic import system to be a bad idea.>
It's not automatic; you have to list the modules. If you don't want data shared, then don't export it!
>
tutorials or examples for your language)I gave an example in my post, of the lead module for my C compiler. Older examples are in that link.
you would list your modules for a program in one place, and then other modules in the program automatically import them all.The logic used in the name resolution pass of the compiler allows visibiliy without needing full name-qualifying.
You can achieve the same thing with 'sqrt = math.sqrt'. Meanwhile my module scheme gives you that for free. With 20 minutes spare I could add an option for to turn it off.from math import sqrtThis is sometimes convenient for functions that you are going to use a lot. At other times, you use "import math" and then refer to "math.sqrt".
>
(which also has the effect of making 'sqrt' part of this module's namespace).
>
Perhaps you simply don't know how teams might work.Perhaps not. So? Not everyone works in a team.
Les messages affichés proviennent d'usenet.