Class extension (dot syntax for new methods)

BlitzMax Forums/BlitzMax Programming/Class extension (dot syntax for new methods)

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.

Yes, unless you're using a third party module that already defines this extension methods for the same base types. Or even funny, if your importing two modules, both of them have a serialize method for the same base class. How do you know what are you calling when you type:

MyClass.Serialize()

isn't it funny?

Also, not to mention you break namespaces.

The method Modserver.Module.Type.ExtendedMethod
is not really scoped at modserver.module, so it can have duplicates, but compile, and you can spect a lot of issues there, unless a very strict rule is applied.

Korilis said the 'closest' one wins, but when both are in a third party module, there's no way to state wich is closest. So, really a good thing to keep in mind, but also a pandora's box as it adds some potentially dangerous scenarios.