Open ngrilly opened 8 years ago
When I wrote polymorphism there I meant class A : public B, public C
ie a class that takes two supers. Not sure what the more specific term for that is, I haven't had time to go in and revise this thing lately. PR's would be appreciated!
Multiple inheritance?
Yep.
Ok, I think the proper term in this context is "subtype polymorphism":
https://en.wikipedia.org/wiki/Polymorphism_(computer_science)
(Deleted a comment on the PR so the conversation is all in one place)
I think Jai actually has subtype polymorphism through using
. May not be getting this syntax right, but:
A :: struct
{
}
B :: struct
{
using a: A;
}
foo :: (a: A)
{
}
b: B;
foo(b); // Should work
When I wrote "polymorphism" in the document I specifically meant multiple inheritance polymorphism, but I think Jai actually has that too with multiple using statements.
Maybe it's best to just remove that line from the document?
I think the "Not planned" section is referring to runtime polymorphism (e.g. C++ polymorphism), while Jai has parametric polymorphism (also known as generics or templates).