An introduction to the Julia language, part 1
An introduction to the Julia language, part 1
Posted Aug 29, 2018 12:44 UTC (Wed) by milesrout (subscriber, #126894)Parent article: An introduction to the Julia language, part 1
Posted Aug 29, 2018 13:17 UTC (Wed)
by Paf (subscriber, #91811)
[Link] (4 responses)
But that’s not fatal or anything - it’ll just end up as a 1 based language with a few angry holdouts switching it to 0 and struggling with non standard library code (of which one hopes there will be a lot, if the language is to really succeed), It’s just I think the switching ability isn’t a good idea, it’s a mild misfeature - it largely opens the possibility of frustration rather than benefit.
Posted Aug 29, 2018 15:28 UTC (Wed)
by leephillips (subscriber, #100450)
[Link] (3 responses)
Posted Aug 29, 2018 17:11 UTC (Wed)
by Paf (subscriber, #91811)
[Link]
Looking at Julia, it appears roughly that the alternately indexed arrays are an explicitly different kind of object from regular arrays...? That seems much better than what it seemed others were describing.
Posted Aug 31, 2018 4:25 UTC (Fri)
by cry_regarder (subscriber, #50545)
[Link]
I've worked around it in fixed index languages by having a constant holding the offset:
o = 3
ugly but readable against the maths.
Posted Sep 6, 2018 6:52 UTC (Thu)
by Wol (subscriber, #4433)
[Link]
And FORTRAN is 1-based and you can't change the index. They were prepared to change and break things when they went from FORTRAN to Fortran, yet this is something they extended rather than broke.
(Don't feed a FORTRAN loop into a Fortran compiler and expect it to work! Incidentally this is 1 or 0 based - a FORTRAN loop is 1-based while a Fortran loop is 0-based :-)
Cheers,
Posted Aug 29, 2018 21:40 UTC (Wed)
by k8to (guest, #15413)
[Link]
I'm not a big fan of having there be multiple indexing conventions though. Just seems like more cognitive load. But maybe it isn't in its targetted domain.
An introduction to the Julia language, part 1
An introduction to the Julia language, part 1
An introduction to the Julia language, part 1
An introduction to the Julia language, part 1
i[0 +o] = i[-3 +o] + i[-1 +o]
An introduction to the Julia language, part 1
Wol
An introduction to the Julia language, part 1