5 ms·
I'm interested to see how records play out in the ecosystem.
by ch4s3 5mo ago
I'm interested to see how records play out in the ecosystem.
- sbrother 5mo agoI was about to say "what, we've had records for decades" but then I read the changelog. Interesting. I wonder if there a world where Elixir starts compiling maps to "native records"?
- dnautics 5mo agoprobably not maps, but structs yes.
- s3cur3 5mo agoI dunno… it’d break a looooot of code if structs were suddenly not also maps. My bet is this becomes a new option you have to manually migrate to.
- dnautics 5mo agoWould it? I bet you could be very clever with transitional guards and the patching compiler to defensively handle both cases on detection of %{...}
- out_of_protocol 5mo agoProbably going to be replacement rather than direct recompilement of structs. I imagine all sorts of corner cases are lurking around if you swap implementation around, e.g. if someone force-pushed unknown key into a struct at runtime. Would be nice to keep current struct syntax though with the only difference in declaration