Ecere SDK/eC Forums • View topic - Operator Overloading (Missing feature?)




Ecere SDK/eC Forums

Ecere Developers Community

Operator Overloading (Missing feature?)

General help with the eC language.

Operator Overloading (Missing feature?)

Postby redj » Wed Feb 09, 2011 11:31 am

Question from JF:
Operator overloading?

Note that A little introduction to eC mentions operator overloading.

-redj
redj
 
Posts: 107
Joined: Sun Jan 17, 2010 10:03 am

Re: Operator Overloading (Missing feature?)

Postby jerome » Wed Feb 09, 2011 2:32 pm

I believe I meant to talk about eC's great unit systems and conversion properties in that little introduction.

This supports things like:

Degrees a = Radians { pi/4 } + Degrees { 60 };

(See attached 'units' test)

It's another way eC advocates 'clear execution points', one thing happening only at one place.
(As opposed to e.g. overload a + and += and - and -= operator, in eC you simply define a conversion function to go to reach a 'common ground, and then the regular C operators work).

The PrintLn syntax mentioned there is eC's alternative to the C++ cout << a << b;

Now operator overloading would be useful for things like vector , matrix and quaternion operations.
For this, we hope to develop some kind of operator overloading support, but that is not done yet.

Our Utopian 'String' class is still something eC is missing, and whether it will overload the + for concatenation or not is still to be disputed.
Attachments
test.units.ec
(3.95 KiB) Downloaded 384 times
jerome
Site Admin
 
Posts: 622
Joined: Sat Jan 16, 2010 11:16 pm


Return to eC Language

Who is online

Users browsing this forum: No registered users and 2 guests

cron