Hi there!
I’m looking for a macro way to deep merge objects.
I’ve found this : Combine two or more structures - Macros - Haxe programming language cookbook
Which is almost good except it doesn’t deep merge.
Is there anybody there that has enough macro knowledge to update this macro so that it’s able to deep merge?
Just to be clear, I’m looking for this:
typedef MyStruct = {
? a : Int
? b : { ? ba : Int, ? bb : String },
? c : String
}
var a : MyStruct = { a: 0, b: { ba: 9} };
var b : MyStruct = { c: '0' };
var c : MyStruct = { a: 3, b: { bb: 'a' } };
var r : MyStruct = combine(a,b,c); // gives: { a: 3, b: { ba: 9, bb: 'a' }, c: '0' }