Neil Jerram <[EMAIL PROTECTED]> writes:
> And at line 899 this code -
>
> if (s[k].ubnd < s[k].lbnd)
> {
> if (1 == SCM_I_ARRAY_NDIM (ra))
> ra = make_typed_vector (scm_array_type (ra), 0);
> else
> SCM_I_ARRAY_V (ra) = make_typed_vector (scm_array_type (ra), 0);
> scm_array_handle_release (&old_handle);
> return ra;
> }
>
> - suggests that the function will do something completely different if
> one of the dimensions of the new array has a negative increment.
No, ubnd < lbnd does not mean that the increment is negative. Ubnd
and lbnd are always sorted so that the smallest legal index is lbnd
and the largest legal index is ubnd (for the dimension at hand). When
ubnd is smaller than lbnd, the index range in that dimension is emtpy
and the whole array has zero elements, consequently. The test in your
snippet 'optimizes' for that case. (Makes me cringe.)
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Bug-guile mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-guile