I would like to work with arrays (lists) whose first element has index 0 like arrays in C or Python. I cannot use Part[] since expr[[0]] is the head of expr and not its first element. I'm sure I'm not the only one to emulate C syntax in Mathematica. How can I do that?
Asked
Active
Viewed 79 times
0
myPart[arr_, i_] := Part[arr, i+1], with additional definitions for other syntaxes ofPart. But I still don't understand the real motivation behind wanting to do something like this. If you explain why you want this, maybe someone can come up with a better suggestion. – Szabolcs Oct 06 '15 at 09:08Table,Sumetc. It's much less hassle to just adapt ;) – Marius Ladegård Meyer Oct 06 '15 at 10:34Partis essentially everySystem`*function implemented top level usesPartand thus you will most likely break them. – Greg Hurst Dec 03 '15 at 00:02