Sure. Thanks.

I haven't tried object variants yet, but what I implemented was effectively a 
union. There can't be any memory savings because all the objects in a seq of an 
object variant must have the same memory layout.

So, it looks like the advantage would be eliminating the case statement for the 
"pseudo-constructors". But, I sort of like what I have because the logic for 
each node kind is more than just populating the struct. For a couple of the 
node kinds there is more to do.

If it was just a matter of populating the right fields of each kind, then I can 
see object variants make the code more compact and still pretty obvious.

And, of course, better than inheritance...

Reply via email to