[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

substring indexes



The following comes from Ken Dickey (kend@tekla).  I favor changing
the description of substring-fill! to say START *to* END.  Peace, Will.

----------------------------------------------------------------
Will,

I have not yet read the full report, but R-cubed is a significant
improvement over R-squared.  I did find section 6.7 on strings,
however, to be somewhat confusing.  Some functions (eg substring) use
START *to* END, while others (eg substring-fill!) use START *through*
END.

I think it would be better to either maintain 

	0 <= START <= END < (string-length <string>)

XOR use 1 based indexing.  

In both cases, I favor using start through end (both inclusive).  The
latter is probably more in keeping with the spirit of Scheme in that
one based indexing seems more natural to naive programmers**.

Pax,
-Ken

-------------
** (based on my experience teaching Pascal and C).