3 ms·
Yeah, it was pretty clear to me... I'm just not sure why they couldn't make array dereferencing a function?
by dnautics 16y ago
Yeah, it was pretty clear to me... I'm just not sure why they couldn't make array dereferencing a function?
- gjm11 16y agoIf you mean having a separate dereferencing function: Dereference[myArray,1,2] is surely much worse than myArray[[1]][[2]]. If you mean having function application mean dereferencing when applied to arrays, so that you'd write myArray[1][2]: they couldn't do that because you can apply the subscripting operations to any expression, so that e.g. F[x,y][[1]] evaluates to x just like {x,y}[[1]] does. (Because {x,y} is shorthand for List[x,y], which has just the same structure as F[x,y] in Mathematica.)