[Nickle] Bug or misunderstanding

Bart Massey bart at po8.org
Wed Dec 29 17:30:56 PST 2004


(Not sure why this wasn't sent previously.  Sigh.)

Fixed.  dims() now returns its dims in proper order.  Note
that the only code in the distro that used dims() is in
examples/apsp.5c, and this has an assertion to make sure
that the array is square :-).

	Bart

In message <Pine.GSO.4.58.0411221450550.24209 at algol.cs.pdx.edu> you wrote:
> 	The following was taken from an interactive nickle session:
> > int[5,3] twoarr;
> > printf("%d %d\n",dims(twoarr)[0], dims(twoarr)[1]);
> 3 5
> Same with the initializer
> >     int [*,*] twoarr2 = ([5, 3]) { [i, j] = -1};
> > printf("%d %d\n",dims(tworr)[0], dims(twoarr2)[1]);
> 3 5
> 
> Why is the size in the first dimension stored in the second element and
> the size in the second dimension stored in the first element returned by
> dims?  I would expect the numbers returned by dims to be in the same order
> as they were in the declaration/initializer.
> 
> Gentlemen . . . Behold!
> 
> _______________________________________________
> Nickle mailing list
> Nickle at nickle.org
> http://nickle.org/mailman/listinfo/nickle



More information about the Nickle mailing list