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
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
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
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
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
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
%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]