digitalmars.D - Make imports private by default
- Frank Benoit (7/7) Apr 13 2006 There was a posting of Tyro
- Derek Parnell (18/25) Apr 13 2006 I think the reason is that all other unadorned symbols in a module are
- Lionello Lunesu (5/7) Apr 13 2006 How about making imports "package" by default? That is, only accessible
- Norbert Nemec (15/47) Apr 13 2006 I fully agree. The rule "everything in a module is public by default" is
- Hasan Aljudy (5/16) Apr 13 2006 I never understood why people use private imports .. just what the hell
- Frank Benoit (18/22) Apr 13 2006 If you do not care about what is imported, why not make an
- Don Clugston (4/21) Apr 13 2006 If module foo publicly imports std.date, then any module which imports
- Hasan Aljudy (12/37) Apr 13 2006 OK, this seems to be a valid problem, however, even if imports become
- clayasaurus (4/36) Apr 13 2006 But at least the error is in the file the dmd compiler says it is, the
- clayasaurus (2/42) Apr 13 2006 Nevermind, I thought you were trying to illustrate a different problem :...
- Hong (3/19) Apr 13 2006 What Frank Benoit wrote seems perfectly understandable for most people. ...
- Sean Kelly (8/25) Apr 13 2006 It's similar to why things can be made private at class scope. Private
- Dan (9/19) Apr 14 2006 I've been doing a fair bit of "aspect oriented" programming. Basically,...
- Bruno Medeiros (16/27) Apr 13 2006 Totally agree.
- Chris Miller (11/33) Apr 13 2006 Good point. Perhaps the current private import should be the default, an...
- kris (17/59) Apr 13 2006 I'm not so sure that makes sense :)
- Derek Parnell (6/10) Apr 13 2006 How many cars have rubber steering wheels? After all, the other wheels a...
- Sean Kelly (3/13) Apr 13 2006 Oh come on, that's a false analogy.
- Chris Miller (4/15) Apr 13 2006 How about an airbag made of buckles?
- Derek Parnell (9/20) Apr 13 2006 Sorry. "the heat of the moment" and all that stuff ... don't know what
- Bruno Medeiros (8/32) Apr 14 2006 I would like a language such as D to strive for the utmost consistency
- Sean Kelly (15/36) Apr 14 2006 I use the term 'consistency' a lot, but a more appropriate term may be
- kris (11/37) Apr 14 2006 I'm a big fan of the "Principal Of Least Surprise", where 'consistency'
- Lars Ivar Igesund (2/5) Apr 14 2006 But then we could at least label it as a bug with certainty.
- kris (7/16) Apr 14 2006 heheh :)
- Don Clugston (11/37) Apr 13 2006 Definitely. Think of the windows API, where windows.d imports dozens of
- David Medlock (4/15) Apr 13 2006 Possibly pertinent discussion on artima:
There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.
Apr 13 2006
On Thu, 13 Apr 2006 20:42:14 +1000, Frank Benoit <benoit__ __tionex.de> wrote:There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I think the reason is that all other unadorned symbols in a module are public so therefore why make an exception with imports. If that is the reason, I think it is not a good one. It assumes that consistency is always a good thing, that new programmers to D are too simple-minded to remember this 'exception', that C/C++ programmers are too simple-minded and thus will get confused, that remembering to type "private { import ... }" is easier to do that remembering (if this is fixed) that imports are already private, that porting C programs is going to be the major activity of D coders in the future, ... Yes, I do think this is a foolish, bureaucratic, simplistic decision to make imports public by default. Who here is going to be seriously affected if imports are made private by default? -- Derek Parnell Melbourne, Australia
Apr 13 2006
I agree with the OP: imports should not be public.Who here is going to be seriously affected if imports are made private by default?How about making imports "package" by default? That is, only accessible to modules in the same package. Might be a nice compromise between "public" and "private". L.
Apr 13 2006
I fully agree. The rule "everything in a module is public by default" is just too simple. A "default" should always consider what is the best solution if people are too lazy to think about the issue. Just consider the two options: * "imports public by default": many libraries will export tons of garbage, just because the authors were lazy. The clear structure of a library will be washed out because, to the user, every symbol is everywhere. * "import private by default": a module will usually export only a small and distinct set of symbols, so you can easily pick those modules that you actually need with minimal risk of conflicts. As an alternative, a large library can always offer "collective modules" that just consist of a list of public imports. So, instead of just sticking to simple principles, the decision should be made based on the effect on the language as a whole. Derek Parnell wrote:On Thu, 13 Apr 2006 20:42:14 +1000, Frank Benoit <benoit__ __tionex.de> wrote:There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I think the reason is that all other unadorned symbols in a module are public so therefore why make an exception with imports. If that is the reason, I think it is not a good one. It assumes that consistency is always a good thing, that new programmers to D are too simple-minded to remember this 'exception', that C/C++ programmers are too simple-minded and thus will get confused, that remembering to type "private { import ... }" is easier to do that remembering (if this is fixed) that imports are already private, that porting C programs is going to be the major activity of D coders in the future, ... Yes, I do think this is a foolish, bureaucratic, simplistic decision to make imports public by default. Who here is going to be seriously affected if imports are made private by default?
Apr 13 2006
Frank Benoit wrote:There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.
Apr 13 2006
I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.If you do not care about what is imported, why not make an import *; by default and everything is OK? No, thats not true. E.g. you make an own class Thread. If every module uses public imports, you will have a good chance std.thread is indirectly imported. So you have to use full qualified names all the time. If not it can happen you use the wrong Thread class. Only because you imported for e.g. std.math (don't know, sort of example) which imports std.stdio, which imports ..... std.thread. You know what i am trying to say? The other thing is, that the compiler has this problem with ambiguity of indirectly imported symbols. Well, last time I run into that problem in december 05. After that i learned to use private imports. If you have existing code and make a refactoring in private methods and decide to remove imports, you can get compile errors in completely other modules. This is because these module never imported the needed module, instead they were imported indirectly. I personally want to know, what is imported from my module.
Apr 13 2006
Hasan Aljudy wrote:Frank Benoit wrote:If module foo publicly imports std.date, then any module which imports foo cannot use std.string.format without colliding with std.date.format. This has bitten me several times already.There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.
Apr 13 2006
Don Clugston wrote:Hasan Aljudy wrote:OK, this seems to be a valid problem, however, even if imports become private by default, there's nothing stopping foo from publicly importing std.date and std.string at the same time. I think what you really want, is to import foo in such a way that you don't import what foo imports, not even what foo publicly imports. So, it's better to have another kind of import .. an import that only imports things directly defined in module foo. shallow import foo; OR direct import foo; or something like that ..Frank Benoit wrote:If module foo publicly imports std.date, then any module which imports foo cannot use std.string.format without colliding with std.date.format. This has bitten me several times already.There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.
Apr 13 2006
Hasan Aljudy wrote:Don Clugston wrote:But at least the error is in the file the dmd compiler says it is, the error for the above problem will be almost impossible for a maintainer to find in a large project.Hasan Aljudy wrote:OK, this seems to be a valid problem, however, even if imports become private by default, there's nothing stopping foo from publicly importing std.date and std.string at the same time.Frank Benoit wrote:If module foo publicly imports std.date, then any module which imports foo cannot use std.string.format without colliding with std.date.format. This has bitten me several times already.There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.
Apr 13 2006
clayasaurus wrote:Hasan Aljudy wrote:Nevermind, I thought you were trying to illustrate a different problem :-/Don Clugston wrote:But at least the error is in the file the dmd compiler says it is, the error for the above problem will be almost impossible for a maintainer to find in a large project.Hasan Aljudy wrote:OK, this seems to be a valid problem, however, even if imports become private by default, there's nothing stopping foo from publicly importing std.date and std.string at the same time.Frank Benoit wrote:If module foo publicly imports std.date, then any module which imports foo cannot use std.string.format without colliding with std.date.format. This has bitten me several times already.There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.
Apr 13 2006
What Frank Benoit wrote seems perfectly understandable for most people. Poluting the namespace is just as meaningful as anything you can get. In article <e1lct1$25an$1 digitaldaemon.com>, Hasan Aljudy says...Frank Benoit wrote:There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.
Apr 13 2006
Hasan Aljudy wrote:Frank Benoit wrote:It's similar to why things can be made private at class scope. Private imports are akin to implementation details--a user of the module shouldn't know or care about them. Public symbols exposed by a module are essentially that module's interface, in much the same was as public symbols of a class are the classes interface. If it isn't something specifically intended for use then it shouldn't be public. SeanThere was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.
Apr 13 2006
I've been doing a fair bit of "aspect oriented" programming. Basically, I'm taking 100k of code and turning it sideways - instead of the methods, class, and arrays all in one file I'm putting all the arrays in one file, splitting groups of methods into separate files, and putting all the 'classes' in a file. It will make the program dramatically easier to understand and thus maintain. However, it necessitates exposing many things across modules. For this purpose, I'm using private imports to get exactly the files I want. It's my opinion though that he's right. For most cases, you should default your CODE to private, not the import.I never understood why people use private imports .. just what the hell is the point? Please give real, concrete examples, not just theories/talk. "Clogging up the namespace" doesn't say anything meaningful to me.It's similar to why things can be made private at class scope. Private imports are akin to implementation details--a user of the module shouldn't know or care about them. Public symbols exposed by a module are essentially that module's interface, in much the same was as public symbols of a class are the classes interface. If it isn't something specifically intended for use then it shouldn't be public.
Apr 14 2006
Frank Benoit wrote:There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.Totally agree. As for the consistency issue, it was said private imports by default where worth the small inconsistency (of everything else being public). Actually I disagree with that at the premise level: I don't think it would be an inconsistency at all. Imports are not members of the module, as they do not even define a new entity. They are not a "part of" the module, they are more like a characteristic of it. Further indication is that there is no "package import". And even "public import", would it be of any significant use? (Of course one could think of imports as the definition of a set of aliases, but really, I would think that's an unadequate and contrived conceptualization) -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Apr 13 2006
On Thu, 13 Apr 2006 12:29:27 -0400, Bruno Medeiros <brunodomedeirosATgmail SPAM.com> wrote:Frank Benoit wrote:Good point. Perhaps the current private import should be the default, and to achieve the current public import, something else could be used, such as "static import" ? Since the majority of imports are private, and even some public ones should have been private, I don't think this change would be difficult. The most common case would then be: * Default, logical choice; * Easier to type; * Better looking code;There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.Totally agree. As for the consistency issue, it was said private imports by default where worth the small inconsistency (of everything else being public). Actually I disagree with that at the premise level: I don't think it would be an inconsistency at all. Imports are not members of the module, as they do not even define a new entity. They are not a "part of" the module, they are more like a characteristic of it. Further indication is that there is no "package import". And even "public import", would it be of any significant use? (Of course one could think of imports as the definition of a set of aliases, but really, I would think that's an unadequate and contrived conceptualization)
Apr 13 2006
Chris Miller wrote:On Thu, 13 Apr 2006 12:29:27 -0400, Bruno Medeiros <brunodomedeirosATgmail SPAM.com> wrote:I'm not so sure that makes sense :) Yes, there's a long standing problem with symbol/namespace collisions and it would be great to resolve that. Bruno suggests that imports are nothing more than a "characteristic" of a module ~ that makes sense, but then couldn't one also think of a class contained therein as a characteristic too? Especially a class that is intended /not/ to be exposed outside of the module (which we apparently cannot hide via package or private; right?). In order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :) Either way, the symbol/namespace collision thing has been thorny for a long time. I'm not so sure that would even be resolved properly by making imports private anyway -- it may mask the problem a little. - KrisFrank Benoit wrote:Good point. Perhaps the current private import should be the default, and to achieve the current public import, something else could be used, such as "static import" ? Since the majority of imports are private, and even some public ones should have been private, I don't think this change would be difficult. The most common case would then be: * Default, logical choice; * Easier to type; * Better looking code;There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.Totally agree. As for the consistency issue, it was said private imports by default where worth the small inconsistency (of everything else being public). Actually I disagree with that at the premise level: I don't think it would be an inconsistency at all. Imports are not members of the module, as they do not even define a new entity. They are not a "part of" the module, they are more like a characteristic of it. Further indication is that there is no "package import". And even "public import", would it be of any significant use? (Of course one could think of imports as the definition of a set of aliases, but really, I would think that's an unadequate and contrived conceptualization)
Apr 13 2006
On Fri, 14 Apr 2006 03:37:14 +1000, kris <foo bar.com> wrote:In order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :)How many cars have rubber steering wheels? After all, the other wheels are made of rubber and we do worship consistency? -- Derek Parnell Melbourne, Australia
Apr 13 2006
Derek Parnell wrote:On Fri, 14 Apr 2006 03:37:14 +1000, kris <foo bar.com> wrote:Oh come on, that's a false analogy. SeanIn order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :)How many cars have rubber steering wheels? After all, the other wheels are made of rubber and we do worship consistency?
Apr 13 2006
On Thu, 13 Apr 2006 22:06:08 -0400, Sean Kelly <sean f4.ca> wrote:Derek Parnell wrote:How about an airbag made of buckles? Seriously, objects in this mirror are closer than that one? [safely ignore this]On Fri, 14 Apr 2006 03:37:14 +1000, kris <foo bar.com> wrote:Oh come on, that's a false analogy.In order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :)How many cars have rubber steering wheels? After all, the other wheels are made of rubber and we do worship consistency?
Apr 13 2006
On Fri, 14 Apr 2006 12:06:08 +1000, Sean Kelly <sean f4.ca> wrote:Derek Parnell wrote:Sorry. "the heat of the moment" and all that stuff ... don't know what came over me. I'm just not convinced yet that "consistency" is the highest design priority. To me, "usability" is more important even if that means that two things are not 'consistent'. -- Derek Parnell Melbourne, AustraliaOn Fri, 14 Apr 2006 03:37:14 +1000, kris <foo bar.com> wrote:Oh come on, that's a false analogy.In order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :)How many cars have rubber steering wheels? After all, the other wheels are made of rubber and we do worship consistency?
Apr 13 2006
Derek Parnell wrote:On Fri, 14 Apr 2006 12:06:08 +1000, Sean Kelly <sean f4.ca> wrote:I would like a language such as D to strive for the utmost consistency and orthogonality but also for "practicality" and "usability" (two qualities often hard to conciliate). So for me too it's not the prime, all-important goal, otherwise I'd be using LISP :P -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#DDerek Parnell wrote:Sorry. "the heat of the moment" and all that stuff ... don't know what came over me. I'm just not convinced yet that "consistency" is the highest design priority. To me, "usability" is more important even if that means that two things are not 'consistent'. --Derek Parnell Melbourne, AustraliaOn Fri, 14 Apr 2006 03:37:14 +1000, kris <foo bar.com> wrote:Oh come on, that's a false analogy.In order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :)How many cars have rubber steering wheels? After all, the other wheels are made of rubber and we do worship consistency?
Apr 14 2006
Derek Parnell wrote:On Fri, 14 Apr 2006 12:06:08 +1000, Sean Kelly <sean f4.ca> wrote:I use the term 'consistency' a lot, but a more appropriate term may be 'predictability'. Basically, I'm willing to bend on consistency so long as the result is still behavior that a novice would consider predictable. That said, I prefer consistency here as the import metaphor isn't limited to just imports--it includes mixins as well. As an aside, it would be really nice if there were a way to expose a single symbol from a privately imported module. 'alias' doesn't work because it will result in multiply defined symbol errors if both modules are imported by a third module. This has come up a lot writing Posix headers because the bulk of them are required to expose one or two symbols from another header such as sys/types. This can be accomplished with preprocessor language in C, but there's no way around publicly importing the entire parent module in D. SeanDerek Parnell wrote:Sorry. "the heat of the moment" and all that stuff ... don't know what came over me. I'm just not convinced yet that "consistency" is the highest design priority. To me, "usability" is more important even if that means that two things are not 'consistent'.On Fri, 14 Apr 2006 03:37:14 +1000, kris <foo bar.com> wrote:Oh come on, that's a false analogy.In order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :)How many cars have rubber steering wheels? After all, the other wheels are made of rubber and we do worship consistency?
Apr 14 2006
Derek Parnell wrote:On Fri, 14 Apr 2006 12:06:08 +1000, Sean Kelly <sean f4.ca> wrote:I'm a big fan of the "Principal Of Least Surprise", where 'consistency' is often a prime factor. You're right, of course, that the latter does not always produce the former, even though it typically does. Further, I suspect that most "veteran" engineers would agree that "all private by default" produces the least surprises over time. Symbolic encapsulation, as a /default/, would probably be a good thing. How hard is it to type the word "public" when necessary? Either way, let's not lose sight of the rather obvious question-mark: would private imports resolve the symbol/namespace collisions? In my humble experience with D, it does not.Derek Parnell wrote:Sorry. "the heat of the moment" and all that stuff ... don't know what came over me. I'm just not convinced yet that "consistency" is the highest design priority. To me, "usability" is more important even if that means that two things are not 'consistent'.On Fri, 14 Apr 2006 03:37:14 +1000, kris <foo bar.com> wrote:Oh come on, that's a false analogy.In order to make D easy to learn and use, surely consistency in usage should be a priority? D kinda has that right now in this particular area, in that everything is public by default. It would also be fine, IMO, if everything were private by default :)How many cars have rubber steering wheels? After all, the other wheels are made of rubber and we do worship consistency?
Apr 14 2006
kris wrote:Either way, let's not lose sight of the rather obvious question-mark: would private imports resolve the symbol/namespace collisions? In my humble experience with D, it does not.But then we could at least label it as a bug with certainty.
Apr 14 2006
Lars Ivar Igesund wrote:kris wrote:heheh :) You can do that today by making most imports explicitly private. Mango is pretty careful about this, where only those things required by ctors are exposed via public or package. Everything else is private. History indicates that things labeled as "bugs" within this realm are simply renamed as "features" :)Either way, let's not lose sight of the rather obvious question-mark: would private imports resolve the symbol/namespace collisions? In my humble experience with D, it does not.But then we could at least label it as a bug with certainty.
Apr 14 2006
Bruno Medeiros wrote:Frank Benoit wrote:Definitely. Think of the windows API, where windows.d imports dozens of modules. It would be very inconvenient to have to list every module you were using (and you'd have to know where they are). A public import of module dog into module bird adds the public members of 'dog' to the interface of 'bird'. It's very rare that this is what you want, but it certainly occurs. I think one way in which it's fundamentally different to classes is that it's natural to have a 'web' of dependencies between modules. It's plausible that importing a single file could clandestinely import a hundred others.There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.Totally agree. As for the consistency issue, it was said private imports by default where worth the small inconsistency (of everything else being public). Actually I disagree with that at the premise level: I don't think it would be an inconsistency at all. Imports are not members of the module, as they do not even define a new entity. They are not a "part of" the module, they are more like a characteristic of it. Further indication is that there is no "package import". And even "public import", would it be of any significant use?(Of course one could think of imports as the definition of a set of aliases, but really, I would think that's an unadequate and contrived conceptualization)
Apr 13 2006
Frank Benoit wrote:There was a posting of Tyro http://www.digitalmars.com/d/archives/digitalmars/D/11081.html Most ppl seconded that. The problem is, that D does not work if you use non-private imports all the time. Suddenly there are conflicts. A public import make the imported module part of this modules interface. This can (and should) be made public explicitely.Possibly pertinent discussion on artima: http://www.artima.com/forums/flat.jsp?forum=106&thread=147355 -DavidM
Apr 13 2006