Re:Julia Language Co-Creators Win James H. Wilkinson Prize f...
by dagw on Wednesday January 23, 2019 @09:56AM
(#18978598)
Julia also supports this (called Offset Arrays)
[ Parent
| on HN ]
Re:Julia Language Co-Creators Win James H. Wilkinson Prize f...
by wycy on Wednesday January 23, 2019 @11:05AM
(#18979392)
Interesting. Doesn't this solve the problem then for people who can't get into 1-indexed arrays?
Re:Julia Language Co-Creators Win James H. Wilkinson Prize f...
by dagw on Thursday January 24, 2019 @03:25AM
(#18986924)
I suppose it kind of does for your own code, but you have to explicitly 'cast' all your arrays to 0-index arrays and it might break anything that assumes it's dealing with a normal 1-index array.
Re:Julia Language Co-Creators Win James H. Wilkinson Prize f...
by dagw on Thursday January 24, 2019 @08:57AM
(#18988664)
And realistically in many cases you won't even notice the indexing as you'll either be iterating over the array or using an array operator rather than accessing elements via an index. And in the remaining cases, much of the time whether the index is 0-based or 1-based won't affect the way the final code looks. Still, it's nice to have the option to 0-index in the few cases where it does make your code cleaner.