Is there any way that static methods could be added to DM? For the long integer library I'm messing with, I have a function defined as follows:
pif_LongInt/UnsignedDouble/proc
Highest()
// Largest unsigned integer representable for an unsigned double-precision integer.
return new /pif_LongInt/UnsignedDouble(0xFFFF, 0xFFFF)
As it stands, this is kind of useless because in order to actually use it, you need to do something like
var/pif_LongInt/UnsignedDouble/i = new
i = i.Highest()
or something similar. There are ways around this, such as defining global variables or a global function that handles it. Unfortunately, the latter completely breaks any notion is being extensible in a nice way, while the former is extremely ugly and requires an object to be defined at runtime for each class. Furthermore, because they are already out there, they could be reassigned or otherwise screwed around with and suddenly the semantics of the code don't align with what's actually going on.
With static methods, I could just do,
pif_LongInt/UnsignedDouble/proc/static
Highest()
return new /pif_LongInt/UnsignedDouble(0xFFFF, 0xFFFF)
var/pif_LongInt/UnsignedDouble/int = /pif_LongInt/UnsignedDouble.Highest()
and all would be nice in the world.