Import improvement

Manu turkeyman at gmail.com
Mon Oct 15 18:19:46 PDT 2012


On 16 October 2012 02:39, 1100110 <0b1100110 at gmail.com> wrote:

> On Mon, 15 Oct 2012 13:38:31 -0500, Chris Nicholson-Sauls <
> ibisbasenji at gmail.com> wrote:
>
>  On Monday, 15 October 2012 at 15:37:06 UTC, Andrei Alexandrescu wrote:
>>
>>> I don't think imports from a specific package have been considered.
>>>
>>> In my personal opinion, imports are a necessary evil and it's sort of a
>>> bummer that the most accessible place in any source file - the top lines -
>>> is occupied by the crappy legal disclaimer (which, after having talked to a
>>> lawyer, I always put at the bottom since being at the top is not a
>>> requirement), and the litany of imports that the module is using. I'd make
>>> all imports local or put them at the bottom of the file if it weren't too
>>> much of a shock to others.
>>>
>>> Three remarks on this particular problem.
>>>
>>> 1. I expect large packages to introduce a module "all.di" or "_.di" to
>>> publicly import everything in the package. That could help some use cases.
>>>
>>
>> It is a common practice (usually all.di) but perhaps it could help to
>> establish an official convention.  Nothing in the language, just the
>> styleguide.  (I know this has already come up and been discussed.)
>>
>
> I like what vibe.d did by having an import all file named d.d
>
> Therefore you can:
> import vibe.d;
>
> It's nice, it's clean, and I've blatantly stolen it for a few of my own
> projects.
>

O_O .. That might be one of the worst things I've ever seen!
It doesn't even make sense. Is there actually a vibe.d file? And why try to
make the import statement look like a source filename?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121016/1726878c/attachment.html>


More information about the Digitalmars-d mailing list