Re: Matrix non-range indexing should return a scalar

2017-07-28 Thread Matthias Boehm
Thanks for bringing this up Mike - this is a useful discussion. Let us first clarify the R semantics. In R, any scalar/vector matrix indexing gives a numeric vector because there are no scalars but vectors of length 1. So Nakul, R does not behave like this proposal. If I remember correctly, Matlab

Re: Matrix non-range indexing should return a scalar

2017-07-28 Thread Imran Younus
+1 Numpy also behaves the way Mike is suggesting here. imran On Fri, Jul 28, 2017 at 5:21 PM, Nakul Jindal wrote: > +1 to Mike & Deron. > > Two other languages/packages that behave like this: > R : http://www.r-tutor.com/r-introduction/matrix > Octave : > https://www.gnu.org/software/octave/do

Re: Matrix non-range indexing should return a scalar

2017-07-28 Thread Nakul Jindal
+1 to Mike & Deron. Two other languages/packages that behave like this: R : http://www.r-tutor.com/r-introduction/matrix Octave : https://www.gnu.org/software/octave/doc/interpreter/Index-Expressions.html -Nakul On Fri, Jul 28, 2017 at 4:03 PM, Deron Eriksson wrote: > Thank you Mike for br

Re: Matrix non-range indexing should return a scalar

2017-07-28 Thread Deron Eriksson
Thank you Mike for bringing this up. To me, this definitely makes sense at the user (DML) level. For a Java-style pseudocode example, currently we require the user to do the following: int[][] m = int[][]{1,2,3,4}; int[][] n = m[0][0]; int x = (int) n; I feel the following would be more 'na