2 ms·
It is and isn't. There is only one access-x function, and it receives obj, which is de facto a pointer into the heap (a boxed object). So it's a case of aliasin
by kazinator 11y ago
It is and isn't. There is only one access-x function, and it receives obj, which is de facto a pointer into the heap (a boxed object). So it's a case of aliasing: "access slot x in this thing, regardless of its specific type". It is analogous to what the C code is doing when it does type punning. It is tangentially relevant because C implementations of dynamic languages sometimes bend the rules to skirt with aliasing.