Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Operator Overloading

Name: Faggot 2010-06-23 17:00

So, I like operator overloading, but I know people who DETEST it. I realized that the reason that I like operator overloading is that I like to write basic types. So I was thinking: What intrinsic types would a language have to provide such that users of that language would never want to create their own? My ideas thus far:

INTEGER - big integer, of course, that does not overflow.
FIXED - a scaled big integer in a wrapper, for when a float is overkill
FLOAT (REAL) - an arbitrary precision floating point number (base 10, of course)
COMPLEX - a pair of REALS, or some complex system (pun not intended) like C99

STRING - a managed array of UTF-32 codepoints, NUL terminated; a normal string class with the exception of the encoding
BUFFER - a managed array of machine types, defaults to unsigned bytes. The only way to have standard (C program) types is if they are boxed in a buffer.

BOOLEAN - it'll still see use

So, what do you think, /prog/, with these seven types (and arrays of them and classes to aggregate them, of course), would you want to overload operators? For those of you who like operator overloading, of course. What sorts of types am I missing?

Name: Anonymous 2010-06-23 21:32

>>6
No shit, sherlock. >>1 said something about a complex system, which I assumed could be extended to more than 2 items.
>>7
It's fine as long as you don't try to multiply vectors and instead implement functions for calculating the dot/cross products.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List