Structs and hot code reloading

I’m curious how modifying the definition of a struct would work with hot code reloading. I’m not too familiar with how they are implemented, and very unfamiliar with hot code reloading, so can only guess at this.

Does anyone know how you would handle adding a property? Removing one? Changing the default value? What would stop working as expected without any intervention? What problems would be insurmountable?

1 Like

Structs are just maps.

However to handle hot-code reloading you really should be implementing code_change callbacks to convert from one version to another as per OTP. :slight_smile:

2 Likes

I suppose I was specifically wondering about the code generated by the defstruct macro, but thinking through it a bit more I don’t see how any of that would be impacted. Just wasn’t sure.

1 Like