> I thought the problem with struct polymorphism (specifically the stack size
> issue) *was* the fundamental reason we can’t have “substructs”.
As I said:
I guess this is the reason we don't have "substructs" now — but inheritance can
be useful without polymorphism:
Imagine an application that managers data of customers and employees.
It would be reasonable to model those data-containers as structs, and as both
structs share many properties, a "person"-type would be quite convenient, even
if it is not possible to create collections which contain customers as well as
employees*.
Tino
* yes, an embedded "address"-struct would be an alternative — but copy & paste
or writing everything in assembler is an alternative as well ;-)
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users