Many questions

grauzone none at example.net
Tue May 5 07:58:31 PDT 2009


Christopher Wright wrote:
> Georg Wrede wrote:
>> Yigal Chripun wrote:
>>> *but*, I do think that splitting one file that got too big over time 
>>> or uniting a bunch of small files into one should be possible.
>>
>> This would be especially good for us. D is mainly developed by 
>> individuals, and there projects tend to grow organically -- as opposed 
>> to the software industry that uses UML and other modeling tools, where 
>> the entire gamut of classes is known before coding starts.
>>
>> So, yes, it should be possible to reorganise code between files 
>> without having to touch the code that uses them.
> 
> It *is* possible, by use of public imports.
> 
> Are you splitting one file into many? Public import the other modules.
> 
> Are you merging many files into one? Leave the other files with just a 
> public import of the merged file.

Nice story. In reality you face all kinds of problems: like circular 
dependency bugs, public/private/package are not fine enough (friend 
modules or a fixed package attribute would be nice), and you still can't 
split the implementation of a class across several files. But yes, I 
guess I could implement a CTFE driven preprocessor using import(), which 
would solve all problems. And then you switch to another language, 
because all the bugs and kludges just isn't it worth.



More information about the Digitalmars-d mailing list