<div class="gmail_quote">On 18 March 2012 03:49, Simen Kjærås <span dir="ltr"><<a href="mailto:simen.kjaras@gmail.com">simen.kjaras@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sun, 18 Mar 2012 02:23:31 +0100, Manu <<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The virtual model broken. I've complained about it lots, and people always<br>
say "stfu, use 'final:' at the top of your class".<br>
<br>
That sounds tolerable in theory, except there's no 'virtual' keyword to<br>
keep the virtual-ness of those 1-2 virtual functions I have... so it's no<br>
good (unless I rearrange my class, breaking the logical grouping of stuff<br>
in it).<br>
So I try that, and when I do, it complains: "Error: variable<br>
demu.memmap.MemMap.machine final cannot be applied to variable", allegedly<br>
a D1 remnant.<br>
So what do I do? Another workaround? Tag everything as final individually?<br>
</blockquote>
<br></div>
class Foo {<br>
    final {<br>
        // Final functions here.<br>
    }<br>
    // Virtual functions here.<br>
}<br>
<br>
Good?</blockquote><div><br></div><div>Ah, didn't think of braces... got stuck on the ':' approach.</div><div>That's no less ugly though, in fact, it's considerably more ugly. more brace spam + indentation levels for nothing.</div>
<div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My minimum recommendation: D needs an explicit 'virtual' keyword, and to<br>
fix that D1 bug, so putting final: at the top of your class works, and<br>
everything from there works as it should.<br>
</blockquote>
<br></div>
I agree that a virtual keyword would sometimes be a boon. With the solution<br>
outlined above, I find it a minor nit, though.<br>
</blockquote></div><br><div>I'm still mortified that people won't do it or just forget, and every method ever will be virtual.</div>