ID:1794005
 
Not Feasible
Applies to:DM Language
Status: Not Feasible

Implementing this feature is not possible now or in the foreseeable future
The ability to add multiple parent types to a datum or atom/movable

[Edit] Horrible [/Edit] Example but you get the idea.
Item
parent_type = /obj
proc/Drop()
//...
Consumable
parent_type = /obj
proc/Use()
//...

Health_Potion
var amount = 444
parent_type = list(/Item,/Consumable)
Use(mob/Mob)
Mob.HP += src.amount
Drop()
..()



While consumables are used hence Use() Item has Drop() So The health potion would be both Item & Consumable. More control over objects and datums.
What if I wanted a non-item to be consumable like an object on the map? What if I didn't want the item to be droppable? It would still have the verb for drop.
This is essentially multiple inheritance ... which I'm going to wager is non-trivial to implement in the compiler, and would involve a certain degree of breaking change in the DMB format ... and frankly isn't a good feature for a learning language like DM.

You start to get into a semantic mess with the following, for example:

Type1
proc/Hello()
world << "Hello!"

Type2
proc/Hello()
world << "Salut!"

Type3
parent_type = list(/Type1, /Type2)


Now, interfaces a la Java? Perhaps a better semantic fit ... but I imagine still a non-trivial change.
In response to Stephen001
Stephen001 wrote:
You start to get into a semantic mess with the following, for example:

> Type1
> proc/Hello()
> world << "Hello!"
>
> Type2
> proc/Hello()
> world << "Salut!"
>
> Type3
> parent_type = list(/Type1, /Type2)
>

Ah I see, but I'm sure there would be a way to check for such a thing :( kinda how you can't have proc/Hello() in type3 it would just give a duplicate definition error.

Alot of useful features have been shot down and it's hard to really even give input or thoughts into new features since the majority of them get marked redundant or never responded to, starting to seem pointless.

It gets more difficult to assess with bigger type graphs. In many respects that is the problem of multiple inheritance, it turns a type hierarchy into a type directed graph, and brings forth semantic complications with it.

But anyway, touching the frustration point: I wouldn't say it's pointless full stop making feature requests, but you do need to consider the position the project is currently in, when doing so, in order to reality check your suggestions. Which, if we're being honest, didn't really happen here. Tom has been quite open I think in expressing his viewpoint that he feels BYOND is a matured project, and his relative happiness in BYOND's language feature-set in particular.

A feature like multiple inheritance is something you'd maybe request of a new language, on a platform that's still very much in it's formation stages and needs to consider what feature-set it wants to provide, in terms of the language. You'd find such a feature request would fall on skeptical or hesitant ears in any mature language, by contrast, and doubly so on platforms that consider themselves to be "essentially done, bar a few specific areas".
In response to Stephen001
Stephen001 wrote:
But anyway, touching the frustration point: I wouldn't say it's pointless full stop making feature requests

So you're saying kinda, gotcha.

Tom has been quite open I think in expressing his viewpoint that he feels BYOND is a matured project

By matured do you mean , unfeasible to the point where 99.8% of the time feature requests are shot down or ignored?

Lummox JR resolved issue (Not Feasible)
I'm pretty sure multiple inheritance has come up as a request before. I just don't see it happening.
Composition works well for this. It's not true multiple inheritance, but it does do its job correctly.

item
var/consumable/consumable

New(C)
..()
if (C) consumable = new()

proc/Use(player/P)
if (consumable) consumable.Use(P)

consumable
var/restore_life

New(N=0)
..()
restore_life = N

proc/Use(player/P)
P.life += restore_life

health_potion
var/item/item

New()
..()
item = new()

proc/Use(player/P)
item.Use(player/P) // similar to super.Use()