It's related to the use case I described in another post about having a map
from a type tag to an object of that type. If I use something like symbols
or keywords to represent type tags, then I'd like to be able to define
something like:
(defalias ComponentTag (U ...))
But then have the flexibility to introduce new component tags later on.
If I used the inheritance with unions method, could I introduce new symbols
that could still typecheck as valid ComponentTags?
Post by Ambrose Bonnaire-SergeantYou can inherit from the type by including it in another union. Extending
a type is something I haven't considered in detail, did you have a use-case
in mind?
Post by Kaylen WheelerI understand that Enums can be fairly easily emulated by unions of value
types. However, is there a way to extend or inherit from such a type?