Re: What the abstrac final class mean?

2019-08-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, August 13, 2019 3:03:49 AM MDT Jacob Carlborg via Digitalmars-d- learn wrote: > On 2019-08-12 11:25, a11e99z wrote: > > its weird that next compiles in some weird form > > > > import std; > > static class A { > > > > static a() { "a".writeln; } // forgot return type > > > > } > >

Re: What the abstrac final class mean?

2019-08-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-08-12 11:25, a11e99z wrote: its weird that next compiles in some weird form import std; static class A {     static a() { "a".writeln; } // forgot return type } Since you have specified an attribute on "a", the compiler can infer the return type. In this case it's inferred to

Re: What the abstrac final class mean?

2019-08-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, August 12, 2019 2:54:56 AM MDT lili via Digitalmars-d-learn wrote: > Hi: > Why need defined an abstract final class? > see > https://github.com/Rikarin/Trinix/blob/master/Kernel/arch/amd64/gdt.d It's one way to effectively create a namespace using a class. Another way would

Re: What the abstrac final class mean?

2019-08-12 Thread a11e99z via Digitalmars-d-learn
On Monday, 12 August 2019 at 09:16:19 UTC, Alex wrote: On Monday, 12 August 2019 at 08:54:56 UTC, lili wrote: Hi: Why need defined an abstract final class? see https://github.com/Rikarin/Trinix/blob/master/Kernel/arch/amd64/gdt.d From what I saw, all members are static. So, this is

Re: What the abstrac final class mean?

2019-08-12 Thread Alex via Digitalmars-d-learn
On Monday, 12 August 2019 at 08:54:56 UTC, lili wrote: Hi: Why need defined an abstract final class? see https://github.com/Rikarin/Trinix/blob/master/Kernel/arch/amd64/gdt.d From what I saw, all members are static. So, this is a kind of utility class, which is not supposed to be

What the abstrac final class mean?

2019-08-12 Thread lili via Digitalmars-d-learn
Hi: Why need defined an abstract final class? see https://github.com/Rikarin/Trinix/blob/master/Kernel/arch/amd64/gdt.d

What is the Final?

2015-01-20 Thread RuZzz via Digitalmars-d-learn
!Widget) is disabled! a = new Widget; // Error! // Cannot assign to rvatue returned by get()! } What is the Final in the code?

Re: What is the Final?

2015-01-20 Thread Rikki Cattermole via Digitalmars-d-learn
Widget a = b; // Error! // opAssign(Finai!Widget) is disabled! a = new Widget; // Error! // Cannot assign to rvatue returned by get()! } What is the Final in the code? I'm guessing something along these lines: struct Final(T) { private T value; alias value this; this(T

Re: What is the Final?

2015-01-20 Thread bearophile via Digitalmars-d-learn
Rikki Cattermole: I'm guessing something along these lines: A Phobos patch: https://github.com/D-Programming-Language/phobos/pull/2881 Bye, bearophile

Re: What is the Final?

2015-01-20 Thread Kagamin via Digitalmars-d-learn
Probably borrowed from java: http://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.12.4