Proposed improvements to the separate compilation model

Manu turkeyman at gmail.com
Sun Mar 3 22:18:25 PST 2013


+1_000_000_000

Yes please!
It's near impossible to get a brief overview of a class at a glance in D!


On 3 March 2013 15:35, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:

> On Friday, 22 July 2011 at 22:06:20 UTC, Andrei Alexandrescu wrote:
>
>> 1. The compiler shall accept method definitions outside a class.
>>
>
> Sorry to bump this old thread, but after having spent some time with D I
> like the idea of having the ability to implement class methods outside of
> the class, but I would like to have this ability in the same file as the
> module:
>
> module test;
>
> class C
> {
>     void foo1();
>
>     void bar1()
>     {
>         // N1 -- two indents
>     }
>
>     class Inner
>     {
>         void foo2();
>         void bar2()
>         {
>             // N2 -- three indents
>         }
>     }
> }
>
> // if allowed:
>
> void C.foo()
> {
>     // 1 indent
> }
>
> void C.Inner.foo2()
> {
>     // 1 indent
> }
>
> The benefit? Avoiding the indentation tax. I've come to find it really
> annoying that hundreds of lines of code end up being indented twice or more
> times. Changing the indentation setting is not a real solution, I like my
> indentation size the way it is, I just don't like being forced to indent
> too much because of the requirement to implement everything inline.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130304/aa42867d/attachment.html>


More information about the Digitalmars-d mailing list