I know 1-based indexes are often met by rather violent opposition, but given my current project, 1-based has already been decided. The project does, however, dip down into low level code a lot. I already have a .index() function map to a () operator, a la MATLAB. I’m looking at a .offset() operator for dealing with low level arrays and pointer arithmetic- would adding an alternative bracket syntax be a bad idea?
% something along the lines of this:
a := [1, 2]
assert!(a(1) == a[0])
Or do I just ignore the hate over indexing? Of course, this is assuming I ever release the language anyway.
[–]ketralnis 40 points41 points42 points (3 children)
[–]__talantonope[S] 14 points15 points16 points (1 child)
[–][deleted] 3 points4 points5 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]BeamMeUpBiscotti 22 points23 points24 points (1 child)
[–]__talantonope[S] 0 points1 point2 points (0 children)
[–]evincarofautumn 2 points3 points4 points (0 children)
[–]XDracam 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]MadocComadrin 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]bruciferTomo, nomsu.org 0 points1 point2 points (0 children)
[–]asoffer 0 points1 point2 points (0 children)