Re: d equivilent of java's public static class fields

2010-08-09 Thread Simen kjaeraas
Jacob Carlborg wrote: Since when is the default access level in D private? Uhm, since I made it up? Sorry about that, I believe I mixed it up with C++. -- Simen

Re: d equivilent of java's public static class fields

2010-08-09 Thread Jacob Carlborg
On 2010-08-08 21:28, Simen kjaeraas wrote: %u wrote: I'm porting some code from Java to D and am getting stuck on what Java calls static class fields. I can't find out how to write the functional (or best practices) equivalent in D. [snip] static int CORRECT = 0; [snip] int asd = Answer.CO

Re: d equivilent of java's public static class fields

2010-08-09 Thread Jacob Carlborg
On 2010-08-08 21:12, %u wrote: I'm porting some code from Java to D and am getting stuck on what Java calls static class fields. I can't find out how to write the functional (or best practices) equivalent in D. (There are other syntax errors in D code, I'm fixing them one by one) # Beg

Re: d equivilent of java's public static class fields

2010-08-08 Thread Lutger
bearophile wrote: > Simen kjaeraas: >> class Answer { >> alias int Correctness; >> enum Correctness CORRECT = 0; >> enum Correctness WRONG = 1; >> >> Correctness _answerCode; >> string _answerText; >> >> @property Correctness answerCode( ) const { >> return

Re: d equivilent of java's public static class fields

2010-08-08 Thread Simen kjaeraas
bearophile wrote: Simen kjaeraas: class Answer { alias int Correctness; enum Correctness CORRECT = 0; enum Correctness WRONG = 1; Correctness _answerCode; string _answerText; @property Correctness answerCode( ) const { return _answerCode; } 'Corr

Re: d equivilent of java's public static class fields

2010-08-08 Thread bearophile
Simen kjaeraas: > class Answer { > alias int Correctness; > enum Correctness CORRECT = 0; > enum Correctness WRONG = 1; > > Correctness _answerCode; > string _answerText; > > @property Correctness answerCode( ) const { > return _answerCode; > } 'Correc

Re: d equivilent of java's public static class fields

2010-08-08 Thread Simen kjaeraas
%u wrote: I'm porting some code from Java to D and am getting stuck on what Java calls static class fields. I can't find out how to write the functional (or best practices) equivalent in D. [snip] static int CORRECT = 0; [snip] int asd = Answer.CORRECT; <-- compile error here [snip]