Mark, Possible Features?

BlitzMax Forums/BlitzMax Programming/Mark, Possible Features?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

What I don't get, is that stuff about function overloading.

Is this about writing 2 functions with the same name and let Blitz decide which one gets called?

Why would anyone do that? I don't see the benefit of it.

I read something about automatic casting, so Blitz could decide, based on a couple of rules, which one to call.
But when you have 5 functions, all with the same name and there is a bug (it doesn't throw an error, but does something different than you want), how do you go about debugging that?

Then you would manually have to follow these rules and understand the inner workings of BMax, just to find the function where the bug is located.

AFAIK, OpenGL doesn't do this.
When creating a new vertex, you would call glVertex2i, glVertex2f, glVertex3f, glVertex4d, ...
Instead of calling glVertex, and let OpenGL decide what to do with the parameters.

Is it really so wrong to have different functions which do the same, but with different parameters types?

For me, this would only increase the confusion when debugging.


But I do support the addition of private fields.
These fields should only be modified by the methods in a type, and not by external functions.
If the user should be able to set and read those fields, just create Set and Get methods.