haxe-evolution icon indicating copy to clipboard operation
haxe-evolution copied to clipboard

abstract + enum + partial order = automatic constuctors

Open 0b1kn00b opened this issue 1 year ago • 2 comments

Using the type system to create automated constructors without substantially impacting the AST is possible, includes working code which demonstrates the approach.

0b1kn00b avatar Dec 20 '24 18:12 0b1kn00b

I don't get what you want to add in this proposal. Can you provide inline examples with and without your feature to show benefits and explain what it does?

RblSb avatar Dec 20 '24 19:12 RblSb

If you order the AST by shortlex ordering, the compiler should be able to derive the grand majority of constructors with that information alone, I don't know if you've seen the macro di implementation but it's not super complex.

0b1kn00b avatar Feb 16 '25 17:02 0b1kn00b