On Tuesday, 15 December 2020 at 19:53:33 UTC, Q. Schroll wrote:
On Monday, 14 December 2020 at 14:39:14 UTC, ddcovery wrote:
On Monday, 14 December 2020 at 12:22:26 UTC, ddcovery wrote:
int opCmp(Number other){
return _value - other.value;
};
Correction:
bool opEquals(Number
On Monday, 14 December 2020 at 14:39:14 UTC, ddcovery wrote:
On Monday, 14 December 2020 at 12:22:26 UTC, ddcovery wrote:
int opCmp(Number other){
return _value - other.value;
};
Correction:
bool opEquals(Number other){
return _value == other.value;
};
You could just give
On Monday, 14 December 2020 at 12:22:26 UTC, ddcovery wrote:
int opCmp(Number other){
return _value - other.value;
};
Correction:
bool opEquals(Number other){
return _value == other.value;
};
In this example, I try to use D Voldemore (fantastic)
functionallity to implement a pattern usually used in javascript.
Basically, a function closure represents the state, and the
methods to access this state are returned in the form of union
(union has not state itself).
void main(){