quarkiverse / quarkus-bon-jova-rockstar

An implementation of Rockstar as a JVM language
https://codewithrockstar.com/
3 stars 2 forks source link

Improve robustness of non numeric array keys #82

Closed holly-cummins closed 9 months ago

holly-cummins commented 9 months ago

I discovered, when I tried to use it in a real program, that my implementation of non-numeric keys was brittle; because it relied on a shadow second variable, accessed by naming convention, it would break when arrays were used in assignments, and also when strings were split into arrays.

I've bitten the bullet and switched to providing an external class which encapsulates the logic. This makes the programs a bit less free-standing, but a lot shorter and cleaner. It also would have saved me a bunch of bytecode generation, had I done this the first time round.