3 ms·
This is possible in ruby too, probably in a lot of languages. I've rewritten someobject#[] plenty of times to have cleaner code.
by killin_dan 9y ago
This is possible in ruby too, probably in a lot of languages.
I've rewritten someobject#[] plenty of times to have cleaner code.
- jksmith 9y agoAll Wirth languages did this. Great for clarity when a specific mapping is needed. Damn I miss me some Modula 2.
- one-more-minute 9y agoOne difference in other languages is that the extra indirection will add overhead. You have to (at the very least) hop through an extra function call, and even that will become significant if you're writing an image kernel. Julia can inline through all the `getindex!` functions so you get the same performance as with a hand-coded C or Fortran array.