Hello Kornalius,
I also think that if implementing operator overloading would be a bit complex to implement and would also slow down not OO programs, why do it ?Assuming that you can simply create methods to perform these operations.
But to be honest I do not understand what you mean by:
#class myclass
Published(value$);
value$ = 10;
func _operator_get
return (value$);
end;
#endclass
proc main
#object object$ myclass
if (object$ > 5)
ShowMessage("Greater!");
end;
end;
a setter and a getter is always lined to a object property, in your example when you say
if (object$ > 5)
it looks like you are testing object itself, but suppose I derive myclass like:
#class myclass newclass
Published(newvalue$);
newvalue$ = 10;
#endclass
what should I put in _operator_get ?
return value$ and newvalue$ ? but what would be the test ?
getter and setter have reason if you can private attributes.
I am sick this week, maybe I missed something.
